- 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版)
- Python自動化運維快速入門(第2版)
- Learning Informatica PowerCenter 10.x(Second Edition)
- 飛槳PaddlePaddle深度學習實戰
- Mastering JBoss Enterprise Application Platform 7
- R大數據分析實用指南
- Python語言實用教程
- 一本書講透Java線程:原理與實踐
- 動手打造深度學習框架
- QGIS 2 Cookbook
- Web編程基礎:HTML5、CSS3、JavaScript(第2版)
- Android嵌入式系統程序開發(基于Cortex-A8)
- Magento 2 Developer's Guide
- Java EE 程序設計