public async Task Handle(ItemMovedToTrash notification, CancellationToken cancellationToken)
        {
            var todoListLayout = await _todoListLayoutRepository.FindLayoutByListIdAsync(notification.ListId.GetValueOrDefault());

            todoListLayout.RemoveItemFromLayout(notification.Item.Id);
            _todoListLayoutRepository.Update(todoListLayout);
            await _todoListLayoutRepository.SaveChangesAsync();
        }
Пример #2
0
        protected override async Task Handle(ListLayout request, CancellationToken cancellationToken)
        {
            var todoListLayout = await _todoListLayout.FindLayoutByListIdAsync(request.ListId);

            todoListLayout.UpdateLayout(request.ItemId, request.Position, request.ListId);

            _todoListLayout.Update(todoListLayout);
            await _todoListLayout.SaveChangesAsync();
        }
        public async Task Handle(TodoListCreated notification, CancellationToken cancellationToken)
        {
            var layout = new TodoListLayout {
                ListId = notification.List.Id
            };

            layout.Id = _todoListLayoutRepository.NextId();

            await _todoListLayoutRepository.AddLayoutAsync(layout);

            await _todoListLayoutRepository.SaveChangesAsync();
        }