Trouvé the documentation. Vous voulez faire quelque chose comme:
public class BloggingModel : ObjectContext
{
public BloggingModel(EntityConnection connection)
: base(connection)
{
DefaultContainerName = "BloggingModel";
}
public IObjectSet<User> Users // ObjectSet name -- you can call it whatever you want
{
get { return base.CreateObjectSet<User>(); }
}
}
class UserConfiguration : EntityConfiguration<User>
{
public UserConfiguration()
{
Property(u => u.Password).HasMaxLength(15).IsRequired();
Relationship(u => u.AuthoredPosts).FromProperty(p => p.Author);
Relationship(u => u.PostedPosts).FromProperty(p => p.Poster);
MapHierarchy(
u => EntityMap.Row(
EntityMap.Column(u.ID, "uid"),
EntityMap.Column(u.Password)
)
).ToTable("Users"); // DB table name -- again, anything you like
}
}
Encore une fois, voir l'article lié pour plus d'informations.
Cette fonctionnalité a été introduite dans CTP 2. Je ne vois aucune documentation nulle part, sauf que le blog de l'équipe ADO.NET note que vous pouvez le faire. –