コード例 #1
0
        public async Task <Result> DeleteAddressEntityAsync(int id)
        {
            try
            {
                var model = await GetAddressEntityAsync(id);

                if (model != null)
                {
                    var data = _iMapper.Map <AddressEntityViewModel, AddressEntity>(model);

                    var saveChange = await _iAddressRepository.DeleteAddressEntityAsync(data);

                    if (saveChange > 0)
                    {
                        return(Result.Ok(MessageHelper.Delete));
                    }
                    else
                    {
                        return(Result.Fail(MessageHelper.DeleteFail));
                    }
                }
                else
                {
                    return(Result.Fail(MessageHelper.DeleteFail));
                }
            }
            catch (Exception)
            {
                throw;
            }
        }