コード例 #1
0
        public async Task ArchiveAsync(int todoListId)
        {
            using (var tran = _unitOfWork.BeginTransaction())
            {
                var storedList = await _todoListRepository.FindAsync(l => l.Id == todoListId, new[] { "Todos" });

                await _todoListService.ArchiveAsync(storedList);

                await _unitOfWork.SaveAsync();

                tran.Commit();
            }
        }
コード例 #2
0
        public async Task <EntityDescriptor> ArchiveAsync(EntityDescriptor todoListDesc)
        {
            using (var tran = _unitOfWork.BeginTransaction())
            {
                var storedList = await _todoListRepository.FindAsync(l => l.Id == todoListDesc.Id, new[] { "Todos" });

                await _todoListService.ArchiveAsync(storedList);

                var prepared = _todoListRepository.PrepareVersioning(todoListDesc);
                await _unitOfWork.SaveAsync();

                tran.Commit();

                return(new EntityDescriptor(prepared));
            }
        }