예제 #1
0
        public void CreateIdSafer()
        {
            var safer = _context.Idsafer.SingleOrDefault(s => s.ID == 1);

            if (safer == null)
            {
                Idsafer safer1 = new Idsafer();
                _context.Idsafer.Add(safer1);
                _context.SaveChanges();
            }
        }
예제 #2
0
 public RentalsController(YourthomeContext context)
 {
     _context = context;
     if (!_context.Rental.Any())
     {
         #region fillDB
         _context.Rental.Add(new Rental {
             Region   = Region.Ik, Street = "Cholponatinskaya", Cost = 1500, Rooms = 3, PropertyType = PropertyType.House,
             RentTime = RentTime.FewDays, Description = "hata top4ik otve4au", Furniture = "TV Tubzik Duw SonyPl4 3krovati", Nearby = "plyaj i bar",
         });
         _context.Rental.Add(new Rental
         {
             Region       = Region.Bishkek,
             Street       = "Cholpon",
             Cost         = 2500,
             Rooms        = 4,
             PropertyType = PropertyType.House,
             RentTime     = RentTime.FewDays,
             Description  = "hata top4ik otve4au",
             Furniture    = "TV Tubzik Duw SonyPl4 3krovati",
             Nearby       = "plyaj i bar",
         });
         _context.Rental.Add(new Rental
         {
             Region       = Region.Ik,
             Street       = "Tutusheva",
             Cost         = 3000,
             Rooms        = 5,
             PropertyType = PropertyType.House,
             RentTime     = RentTime.FewDays,
             Description  = "hata top4ik otve4au",
             Furniture    = "TV Tubzik Duw SonyPl4 3krovati",
             Nearby       = "plyaj i bar",
         });
         _context.Rental.Add(new Rental
         {
             Region       = Region.Bishkek,
             Street       = "Soviet",
             Cost         = 12500,
             Rooms        = 3,
             PropertyType = PropertyType.Apartment,
             RentTime     = RentTime.Longterm,
             Description  = "hata top4ik otve4au",
             Furniture    = "TV Tubzik Duw SonyPl4 3krovati",
             Nearby       = "plyaj i bar",
         });
         _context.Rental.Add(new Rental
         {
             Region       = Region.Bishkek,
             Street       = "Gapar Aitiev",
             Cost         = 14500,
             Rooms        = 1,
             PropertyType = PropertyType.Apartment,
             RentTime     = RentTime.FewDays,
             Description  = "hata top4ik otve4au",
             Furniture    = "TV Tubzik Duw SonyPl4 3krovati",
             Nearby       = "plyaj i bar",
         });
         _context.Rental.Add(new Rental
         {
             Region       = Region.Ik,
             Street       = "Cholponaqgq",
             Cost         = 3500,
             Rooms        = 2,
             PropertyType = PropertyType.House,
             RentTime     = RentTime.Night,
             Description  = "hata top4ik otve4au",
             Furniture    = "TV Tubzik Duw SonyPl4 3krovati",
             Nearby       = "plyaj i bar",
         });
         _context.Rental.Add(new Rental
         {
             Region       = Region.Ik,
             Street       = "Alieva",
             Cost         = 6500,
             Rooms        = 7,
             PropertyType = PropertyType.House,
             RentTime     = RentTime.FewDays,
             Description  = "hata top4ik otve4au",
             Furniture    = "TV Tubzik Duw SonyPl4 3krovati",
             Nearby       = "plyaj i bar",
         });
         _context.Rental.Add(new Rental
         {
             Region       = Region.Bishkek,
             Street       = "7aprelya",
             Cost         = 1500,
             Rooms        = 3,
             PropertyType = PropertyType.Apartment,
             RentTime     = RentTime.FewDays,
             Description  = "hata top4ik otve4au",
             Furniture    = "TV Tubzik Duw SonyPl4 3krovati",
             Nearby       = "plyaj i bar",
         });
         _context.Rental.Add(new Rental
         {
             Region       = Region.Ik,
             Street       = "Balykina",
             Cost         = 1500,
             Rooms        = 1,
             PropertyType = PropertyType.Apartment,
             RentTime     = RentTime.Night,
             Description  = "hata top4ik otve4au",
             Furniture    = "TV Tubzik Duw SonyPl4 3krovati",
             Nearby       = "plyaj i bar",
         });
         _context.Rental.Add(new Rental
         {
             Region       = Region.Ik,
             Street       = "Cholponatinskaya",
             Cost         = 1500,
             Rooms        = 3,
             PropertyType = PropertyType.House,
             RentTime     = RentTime.FewDays,
             Description  = "hata top4ik otve4au",
             Furniture    = "TV Tubzik Duw SonyPl4 3krovati",
             Nearby       = "plyaj i bar",
         });
         #endregion
         _context.SaveChanges();
     }
 }