public async Task CreateAddress(ObjectId id, string link, string category) { var address = await _addressRepository.GetAddressAsync(id); if (address == null) { throw new Exception($"Id's Address: '{id}' already exists."); } address = new Address(id, link, category); await _addressRepository.AddAddressAsync(address); }
public async Task <bool> AddAddressAsync(Address address) { Console.WriteLine("AddressService implementation run trough API.Services.AddressService.AddAddress()"); if (await _addressRepository.AddAddressAsync(address)) { return(true); } else { throw new Exception(); } }