Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Datasets and namepaces
Message
De
02/07/2011 13:32:39
 
 
À
02/07/2011 11:39:24
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
C# 3.0
Divers
Thread ID:
01517067
Message ID:
01517153
Vues:
30
Say: Common assemly:
using System.Data;
namespace Common
{
    public class SomeStronglyTypedDataSet : DataSet
    {
    }
}
Assembly B:
namespace ProjectB
{
    public class SomeClass
    {
        public void DoSomethingWithDS(Common.SomeStronglyTypedDataSet ds)
        {
        }
    }
}
Then in ProjectA:
namespace ProjectA
{
    public class SomeClass
    {
        public void SomeMethod()
        {
        Common.SomeStronglyTypedDataSet ds = new Common.SomeStronglyTypedDataSet();
        ProjectB.SomeClass  sc = new ProjectB.SomeClass();
        sc.DoSomethingWithDS(ds);
        }
    }
}
Both A and B need a reference to Common. A also needs a reference to B.


>Hmm
>I like that
>If i put the class in an assembly, will I be able to pass a stronglyped dataset from the project's namespace as an argument to a method in the assembly?
>What type will the parameter in the method in the assembly have?
>
>
>
>
>>>Why did you need to have the class in both ProjectA and ProjectB ?
>In any case it would probably be better to put such a class in a separate 'Common' assembly and reference that assembly from all three of the existing projects.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform