public async Task <LocationContact> UpdateContactAddressAsync(long ownerId, long restaurantId, long contactId, int floor, string steetNumber, string route, string locality, string country, int zipCode, float latitude, float longitude, [Optional] string administrativeAreaLevel1, [Optional] string administrativeAreaLevel2, [Optional] string googleLink) { EmployersRestaurants connection = await CheckEmployerRestaurantAsync(ownerId, restaurantId); LocationContact contact = await CheckLocationExistenceAsync(contactId); LocationPoints point = await CheckLocationPointExistenceAsync(contact.LocationPointId); point.Latitude = latitude; point.Longitude = longitude; CheckTheLoggedInPerson(); await PointRepo.UpdateAsync(point, ModifierId); contact.FillOrUpdateFields(floor, steetNumber, route, locality, country, zipCode, administrativeAreaLevel1, administrativeAreaLevel2, googleLink); await LocationRepo.UpdateAsync(contact, ModifierId); return(contact); }
private void ChangeLocationContact(LocationContactDto dto, Location location, LocationContact locationContact) { RemoveLocationContact(dto, location, locationContact); AddLocationContact(dto, location); }
private static void RemoveLocationContact(LocationContactDto dto, Location location, LocationContact locationContact) { location.RemoveContacts(locationContact); }