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

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.

主站蜘蛛池模板: 延寿县| 都匀市| 宽城| 张家界市| 会宁县| 民权县| 广东省| 苍溪县| 巴东县| 金湖县| 石棉县| 垦利县| 湄潭县| 淄博市| 根河市| 蒲江县| 成武县| 宾阳县| 水城县| 淮北市| 子洲县| 三明市| 洪江市| 红桥区| 武川县| 广平县| 娱乐| 区。| 塔河县| 仁布县| 如东县| 满洲里市| 卫辉市| 东光县| 玉山县| 图们市| 广河县| 礼泉县| 全州县| 清水县| 茌平县|