ASP.NET: Databases
Define, store, and edit information in your ASP.NET web app using databases, models, and LINQ
StartKey Concepts
Review core concepts you need to learn to master this subject
Database Model
Database Context
DbSet Type
Entity Framework Configuration
Database Connection String
Creating the Schema
Model Binding
Adding Records
Database Model
Database Model
using System;
public class Country
{
public string ID { get; set; }
public string ContinentID { get; set; }
public string Name { get; set; }
public int? Population { get; set; }
public int? Area { get; set; }
public DateTime? UnitedNationsDate { get; set; }
public Continent Continent { get; set; }
}
Entity Framework uses C# classes to define the database model. This is an in-memory representation of data stored in a database table. Several model classes combine to form the schema for the database.
Each property maps to a column in a database table. The bottom line in the example shows a type of Continent
which implies a relationship to another table.
What you'll create
Portfolio projects that showcase your new skills
How you'll master it
Stress-test your knowledge with quizzes that help commit syntax to memory