fluentapi

Building a Code-First Model Using FluentAPI in Entity Framework

Now that we've created a Code-First model using Attributes, let's walk through the other manner by which we can create a model: FluentAPI. The Model Once again, we will be using the same CourseCatalog model: To start off, let's create the classes necessary to represent these entities: public class Student { public int ID { get; set; } public string FirstName { get; set; } public string LastName { get; set; } public DateTime DateOfBirth { get; set; } public virtual StudentAddress Address { get; set; } public virtual ICollection<... Read more >