private async Task <bool> HandleAsync(DeleteLabelFromItemCommand command) { var itemLabel = await this.context.ItemLabels .FirstOrDefaultAsync(il => il.LabelId == command.LabelId && il.ItemId == command.ItemId); if (itemLabel == null) { return(true); } this.context.ItemLabels.Remove(itemLabel); var count = await this.context.SaveChangesAsync(); return(count >= 0); }
public async Task <bool> DeleteLabel([FromBody] DeleteLabelFromItemCommand command) { return(await commandProcessor.ProcessAsync(command)); }