Esempio n. 1
0
        public async Task <BaseResult> Delete(int id)
        {
            var result = new BaseResult()
            {
                Result = Result.Success
            };

            result = await _orderItemService.DeleteByOrder(id);

            var Delete = _orderRepository.GetById(id);

            if (Delete == null)
            {
                result.Result  = Result.Failed;
                result.Message = "Không có ";
                return(result);
            }
            try
            {
                await _orderRepository.DeleteAsync(Delete);
            }
            catch (Exception e)
            {
                result.Result  = Result.SystemError;
                result.Message = e.ToString();
            }
            return(result);
        }