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(); }
public static void AddEmployees(StudioDbContext context) { var industryId = CommandArrangeHelper.GetIndustryId(context); var serviceId = CommandArrangeHelper.GetServiceId(context, industryId); var addressId = CommandArrangeHelper.GetAddressId(context, null); var locationId = CommandArrangeHelper.GetLocationId(context, null, addressId); var employee = new Employee { Id = 1, FirstName = GConst.ValidName, LastName = GConst.ValidName, LocationId = locationId }; context.Employees.Add(employee); var employeeService = new EmployeeService { ServiceId = serviceId, EmployeeId = employee.Id }; context.EmployeeServices.Add(employeeService); context.SaveChanges(); }