Beispiel #1
0
        public override Result <Address> Register(AddressModel addressModel)
        {
            try
            {
                Address address = _mapper.Map <Address>(addressModel);

                var result = _addressValidation.Validate(address);
                if (!result.Success)
                {
                    return(result);
                }

                _addressDAL.Insert(address);
                return(Result <Address> .BuildSuccess(address));
            }
            catch (Exception error)
            {
                return(Result <Address> .BuildError("Erro no momento de registar o endereço.", error));
            }
        }
Beispiel #2
0
 public bool Add(Address address)
 {
     return(_addressDAL.Insert(address));
 }