using System.Data.Entity;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
public static void Main()
using (var context = new BookStore())
context.Database.Log = Console.WriteLine;
Author author1 = new Author() { Name = "Mark" };
Author author2 = new Author() { Name = "John" };
context.Authors.Add(author1);
context.Authors.Add(author2);
public class BookStore : DbContext
public BookStore() : base(FiddleHelper.GetConnectionStringSqlServer())
public DbSet<Author> Authors { get; set; }
public int AuthorId { get; set; }
public string Name { get; set; }