Example #1
0
        public override void Update(Address address)
        {
            if (_repositoryAddress.Get(address.Id) == null)
            {
                throw new ApplicationException("Address not found.");
            }

            _repositoryAddress.Update(address);
        }
Example #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="request"></param>
        /// <param name="context"></param>
        /// <returns></returns>
        public override Task <AddressGet> Get(Request request, ServerCallContext context)
        {
            var address = _repositoryAddress.Get(request.Id);

            return(Task.FromResult(new AddressGet
            {
                Id = address.Id.Value,
                ZipCode = address.ZipCode,
                PublicArea = address.PublicArea,
                City = address.City,
                Neighborhood = address.Neighborhood,
                State = address.State
            }));
        }