public async Task <CardSection> UpdateAsync(CardSectionUpdate toUpdate, CancellationToken cancellationToken = default) { var cardSection = await _context.CardSections.SingleAsync(c => c.Id == toUpdate.Id, cancellationToken); cardSection.UpdateFrom(toUpdate); cardSection.UpdatedOn = DateTime.UtcNow; await _context.SaveChangesAsync(cancellationToken); return(cardSection); }
public static void UpdateFrom(this CardSection cardSection, CardSectionUpdate update) { cardSection.Title = update.Title; }