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

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.

主站蜘蛛池模板: 南平市| 祁门县| 仁布县| 巴林右旗| 曲阜市| 镇康县| 凤翔县| 墨玉县| 舟曲县| 河池市| 武川县| 吴堡县| 大英县| 丹阳市| 阿克陶县| 洞口县| 霍州市| 安远县| 武安市| 天等县| 阿克| 高安市| 炉霍县| 承德市| 龙江县| 布拖县| 黎城县| 安仁县| 通道| 平安县| 曲靖市| 山西省| 措勤县| 井研县| 吴忠市| 女性| 呼玛县| 宁津县| 芜湖县| 沂南县| 开封县|