using System.Data.Entity;
using System.Collections;
using System.Collections.Generic;
public static void Main()
using (var ctx = new SchoolContext())
var stud = new Student() { StudentName = "Bill" };
Console.Write("Student saved successfully!");
FiddleHelper.WriteTable("Student", ctx.Students.ToList());
public class SchoolContext: DbContext
public SchoolContext() : base(FiddleHelper.GetConnectionStringSqlServer())
public DbSet<Student> Students { get; set; }
public DbSet<Grade> Grades { get; set; }
public int StudentID { get; set; }
public string StudentName { get; set; }
public DateTime? DateOfBirth { get; set; }
public byte[] Photo { get; set; }
public decimal Height { get; set; }
public float Weight { get; set; }
public Grade Grade { get; set; }
public int GradeId { get; set; }
public string GradeName { get; set; }
public string Section { get; set; }
public ICollection<Student> Students { get; set; }