官术网_书友最值得收藏!

Working with the Post entity

In Chapter 1, Kickstart - Introduction to Entity Framework Core, even the Post model was discussed in detail, except we have a virtual Blog property, which is nothing but a navigational property:

    public partial class Post
{
public int Id { get; set; }
public int BlogId { get; set; }
public string Content { get; set; }
public DateTime PublishedDateTime { get; set; }
public string Title { get; set; }
public virtual Blog Blog { get; set; }
}

We have seen the differences between the model created manually in Chapter 1Kickstart - Introduction to Entity Framework Core, and the auto-generated models. Let's see how the database context configuration could be made generic rather than hardcoding the connection string inside the code.

主站蜘蛛池模板: 济源市| 宁晋县| 黄大仙区| 正宁县| 秦安县| 郸城县| 长子县| 广河县| 华安县| 青铜峡市| 盐亭县| 北川| 色达县| 蒙城县| 类乌齐县| 莱阳市| 平凉市| 武义县| 磐安县| 闸北区| 宜城市| 德江县| 东乡族自治县| 江都市| 温州市| 缙云县| 集安市| 阿鲁科尔沁旗| 黑龙江省| 桂林市| 和静县| 固原市| 卢龙县| 北流市| 琼海市| 东至县| 深泽县| 麟游县| 平舆县| 温泉县| 郎溪县|