Exemple #1
0
        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);
        }
Exemple #2
0
 public static void UpdateFrom(this CardSection cardSection, CardSectionUpdate update)
 {
     cardSection.Title = update.Title;
 }