Example #1
0
 public static void AddClients(this RealEstateContext context)
 {
     context.Clients.AddRange(new[]
     {
         new Client
         {
             FirstName  = "Андрей",
             MiddleName = "Игоревич",
             LastName   = "Титько",
             Phone      = "0930088172"
         },
         new Client
         {
             FirstName  = "Марьяна",
             MiddleName = "Степановна",
             LastName   = "Глушко",
             Phone      = "0933337100"
         },
         new Client
         {
             FirstName  = "Инокентий",
             MiddleName = "Абрамович",
             LastName   = "Рубдинский",
             Phone      = "0665157129"
         },
     });
     context.SaveChanges();
 }
Example #2
0
 public static void AddAppartments(this RealEstateContext context)
 {
     context.Appartments.AddRange(new[]
     {
         new Appartment
         {
             Address     = "Харьков, Космическая 10, 12кв",
             Area        = 55.0,
             RoomsAmount = 2,
             Storey      = 4,
             Price       = 35000.0,
         },
         new Appartment
         {
             Address     = "Харьков, Гарибальди 8, 24кв",
             Area        = 42.0,
             RoomsAmount = 1,
             Storey      = 5,
             Price       = 27000.0,
         },
         new Appartment
         {
             Address     = "Харьков, ак.Вальтера 12, 36кв",
             Area        = 47.0,
             RoomsAmount = 1,
             Storey      = 2,
             Price       = 30000.0,
         },
     });
     context.SaveChanges();
 }
Example #3
0
 public static void RunSeeds(this RealEstateContext context)
 {
     context.AddUsers();
     context.AddClients();
     context.AddAppartments();
     context.AddDeals();
 }
Example #4
0
 public static void AddDeals(this RealEstateContext context)
 {
     context.Deals.AddRange(new[]
     {
         new Deal {
             Appartment = context.Appartments.First(app => app.RoomsAmount == 1), Client = context.Clients.First()
         },
         new Deal {
             Appartment = context.Appartments.First(app => app.RoomsAmount == 2), Client = context.Clients.First(), IsConfirmed = true
         },
     });
     context.SaveChanges();
 }
Example #5
0
 public static void AddUsers(this RealEstateContext context)
 {
     context.Users.AddRange(new[]
     {
         new User {
             Name = "user", Password = "******", IsAdmin = false
         },
         new User {
             Name = "admin", Password = "******", IsAdmin = true
         },
     });
     context.SaveChanges();
 }