Exemple #1
0
        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);
        }
Exemple #2
0
        public async Task <ActionResult <Unit> > Delete(DeletePortfolio request)
        {
            Unit result = await mediator.Send(request);

            return(result);
        }