- 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.
推薦閱讀
- Spring Cloud Alibaba核心技術與實戰案例
- 老“碼”識途
- 零基礎學Python數據分析(升級版)
- Cybersecurity Attacks:Red Team Strategies
- 智能手機故障檢測與維修從入門到精通
- Cocos2d-x by Example:Beginner's Guide(Second Edition)
- 貫通Tomcat開發
- Python編程基礎教程
- Mastering Bootstrap 4
- Design Patterns and Best Practices in Java
- MySQL數據庫教程(視頻指導版)
- HTML5程序開發范例寶典
- Python機器學習
- 高性能MVVM框架的設計與實現:San
- Roslyn Cookbook