コード例 #1
0
        public async Task <Item> Delete(Item Item)
        {
            if (!await ItemValidator.Delete(Item))
            {
                return(Item);
            }

            try
            {
                await UOW.Begin();

                await UOW.ItemRepository.Delete(Item);

                await UOW.Commit();

                await UOW.AuditLogRepository.Create("", Item, nameof(ItemService));

                return(Item);
            }
            catch (Exception ex)
            {
                await UOW.Rollback();

                await UOW.SystemLogRepository.Create(ex, nameof(ItemService));

                throw new MessageException(ex);
            }
        }