August 2018
Intermediate to advanced
298 pages
5h 33m
English
The Model classes are simple POCO objects that can be used with Entity Framework.
Let's create a POCO class for our business domain object, the Employee class in our case. Name the new file name Employee.cs in our console application. This Employee class contains a few properties of an employee and has no special properties or fields to make it work with Entity Framework.
Let's take a look at the following code snippet:
public class Employee{ public int EmployeeId { get; set; } public string Name { get; set; } public decimal Salary { get; set; } public string Designation { get; set; }}
By convention, if the property name is Id or ClassName+Id, it will be considered as a primary key by the Entity Framework while creating ...
Read now
Unlock full access