public async Task <AddressApiModel.Response> UpdateAdress(AddressApiModel.Request address) { Address newAddress = new Address { UserId = new Guid(address.userId), country = address.country, city = address.city, postcode = address.postcode, adressLine = address.adressLine, neighborhood = address.neighborhood, street = address.street }; applicationDbContext.addresses.Update(newAddress); await applicationDbContext.SaveChangesAsync(); AddressApiModel.Response rsulte = new AddressApiModel.Response { userId = newAddress.UserId.ToString(), country = address.country, city = address.city, postcode = address.postcode, adressLine = address.adressLine, neighborhood = address.neighborhood, street = address.street }; return(rsulte); }
public AddressApiModel.Response GetAddress(Guid UserId) { //get the oder info Address address = applicationDbContext.addresses.Find(UserId); AddressApiModel.Response rsulte = new AddressApiModel.Response { userId = address.UserId.ToString(), country = address.country, city = address.city, postcode = address.postcode, adressLine = address.adressLine, neighborhood = address.neighborhood, street = address.street }; return(rsulte); }