public static void AddAddresses(StudioDbContext context) { InputAddressData addressData = new InputAddressData { Street = "Vasil Levski", Number = "10", Building = "3G", Entrance = "B" }; var cityId = CommandArrangeHelper.GetCityId(context, null); var addresses = new List <Address> { new Address { Id = 1, AddressFormat = (AddressFormat)addressData, Longitude = 40.35M, Latitude = 56.23M, CityId = cityId }, new Address { Id = 2, AddressFormat = (AddressFormat)addressData, Longitude = 40.35M, Latitude = 56.23M, CityId = cityId }, new Address { Id = 3, AddressFormat = (AddressFormat)addressData, Longitude = 40.35M, Latitude = 56.23M, CityId = cityId } }; context.Addresses.AddRange(addresses); context.SaveChanges(); }
public static void AddLocations(StudioDbContext context) { var cityId = CommandArrangeHelper.GetCityId(context, null); var addressId = CommandArrangeHelper.GetAddressId(context, cityId); var clientId = CommandArrangeHelper.GetClientId(context); var locations = new List <Location> { new Location { Id = 1, Name = GConst.ValidName, StartDay = Workday.Понеделник, EndDay = Workday.Петък, StartHour = "9", EndHour = "18", Phone = "0888777666", AddressId = addressId, ClientId = clientId } }; context.Locations.AddRange(locations); context.SaveChanges(); }