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

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.

主站蜘蛛池模板: 江安县| 仪陇县| 平泉县| 福鼎市| 砚山县| 抚顺县| 惠水县| 高青县| 荔浦县| 荃湾区| 施甸县| 扬中市| 黎川县| 阳西县| 探索| 龙南县| 香格里拉县| 拜泉县| 平阴县| 常熟市| 东源县| 潢川县| 禹州市| 高安市| 建德市| 蛟河市| 瓦房店市| 隆化县| 丽江市| 崇明县| 古浪县| 新兴县| 商都县| 微博| 贺州市| 长泰县| 太仆寺旗| 上杭县| 镇坪县| 彭泽县| 呼图壁县|