public partial class EntrepriseDataContext : DataContext {
[StoredProcedure(Name = "dbo.LireSiteEtAdresse")]
public IMultipleResults LireSiteEtAdresse2()
{
return ExecuteMethodCallWithMultipleResults(this,
(MethodInfo)MethodInfo.GetCurrentMethod());
}
var q = edc.LireSiteEtAdresse2();
foreach (Site s in q.GetResult<Site>())
Console.WriteLine(s.AdresseID + " " + s.Code + " " + s.Nom);
foreach (Adresse a in q.GetResult<Adresse>())
Console.WriteLine(a.Ville + " " + a.Rue);
[Table(Name="dbo.Projet")]
[InheritanceMapping(Code = "DSI", Type = typeof(ProjetInformatique))]
[InheritanceMapping(Code = "LGQ", Type = typeof(ProjetLogistique))]
[InheritanceMapping(Code = "MKG", Type = typeof(ProjetMarketing))]
[InheritanceMapping(Code = "ORG", Type = typeof(BaseProjet),IsDefault=true)]
public class BaseProjet {
[Column(IsPrimaryKey = true)]
public int ProjetID;
[Column]
public string Nom;
[Column(IsDiscriminator = true)]
public string CodeTypeProjet;
public int ChefDeProjetID;
public class ProjetInformatique : BaseProjet {
public string CodeProgramme;
var q = edc.GetTable<BaseProjet>().OfType<ProjetInformatique>();
foreach (BaseProjet p in q)
Console.WriteLine(p.Nom + " " + p.CodeTypeProjet);