public async Task <Unit> Handle(UpdateProfilOptionCommand <Sex> request, CancellationToken cancellationToken) { var sex = await _context.FindAsync <Sex>(request.Id); sex.Name = request.Name; _context.Update(sex); await _context.SaveChangesAsync(cancellationToken); return(Unit.Value); }
public async Task <Unit> Handle(DeleteDocumentCommand request, CancellationToken cancellationToken) { var document = await _context.FindAsync <Document>(request.DocumentId); document.IsDelete = true; _context.Update(document); await _context.SaveChangesAsync(cancellationToken); return(Unit.Value); }
public async Task <Unit> Handle(UpdateProfilOptionCommand <ChildrenAgeBracket> request, CancellationToken cancellationToken) { var childrenAgeBracked = await _context.FindAsync <ChildrenAgeBracket>(request.Id); childrenAgeBracked.Name = request.Name; _context.Update(childrenAgeBracked); await _context.SaveChangesAsync(); return(Unit.Value); }
public async Task <Unit> Handle(DeleteProfilOptionCommand <YearlyIncome> request, CancellationToken cancellationToken) { var yearlyIncome = await _context.FindAsync <YearlyIncome>(request.Id); yearlyIncome.IsDelete = true; _context.Update(yearlyIncome); await _context.SaveChangesAsync(cancellationToken); return(Unit.Value); }