Пример #1
0
        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);
        }
Пример #2
0
        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();
            }
        }