-1
FKプロパティの関連ナビゲーションプロパティを検索する必要があります。Entity Framework:FKプロパティによる関連ナビゲーションプロパティの検索
は、これは私のモデルである:私は最初のコードでEF 6.2を使用してい
var context = new BloggingContext();
var navigationProperty = GetNavigationProperty(context, typeof(Post), "BlogId"); // returns "Blog"
:
public class Blog
{
public int BlogId { get; set; }
public string Url { get; set; }
public virtual ICollection<Post> Posts { get; set; }
}
public class Post
{
public int PostId { get; set; }
public string Title { get; set; }
public string Body { get; set; }
public int BlogId { get; set; }
public virtual Blog Blog { get; set; }
}
public class BloggingContext : DbContext
{
public DbSet<Blog> Blogs { get; set; }
public DbSet<Post> Posts { get; set; }
}
は今、私はこのような何かを書きたいです。
ありがとうございました!