public async Task <Unit> Handle(DeletePortfolio request, CancellationToken cancellationToken) { Portfolio v = await ctx.Portfolios.Include(v => v.Files).SingleAsync(v => v.Id == request.Id); ctx.Remove(v); ctx.RemoveRange(v.Files); await ctx.SaveChangesAsync(); return(Unit.Value); }
public async Task <ActionResult <Unit> > Delete(DeletePortfolio request) { Unit result = await mediator.Send(request); return(result); }