- Mastering Entity Framework Core 2.0
- Prabhakaran Anbazhagan
- 132字
- 2021-07-02 21:16:40
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 1, Kickstart - 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.
推薦閱讀
- 摩登創(chuàng)客:與智能手機(jī)和平板電腦共舞
- Python Game Programming By Example
- MATLAB實(shí)用教程
- Learning Laravel 4 Application Development
- Learning Neo4j 3.x(Second Edition)
- HTML5從入門到精通(第4版)
- Scratch3.0趣味編程動(dòng)手玩:比賽訓(xùn)練營
- TMS320LF240x芯片原理、設(shè)計(jì)及應(yīng)用
- Geospatial Development By Example with Python
- C++ Fundamentals
- Java 9 Programming By Example
- 監(jiān)控的藝術(shù):云原生時(shí)代的監(jiān)控框架
- Greenplum構(gòu)建實(shí)時(shí)數(shù)據(jù)倉庫實(shí)踐
- Docker:容器與容器云(第2版)
- JavaScript高級(jí)程序設(shè)計(jì)(第4版)