public NotificationComment Create(NotificationComment itemToCreate) { var comment = _context.NotificationComments.Add(itemToCreate); _context.SaveChanges(); return(comment); }
public async Task <bool> Add(NotificationComment comment) { context.NotificationComments.Add(comment); await context.SaveChangesAsync(); return(true); }
public NotificationComment Update(NotificationComment itemToUpdate) { _context.Entry(itemToUpdate).State = EntityState.Modified; _context.SaveChanges(); return(itemToUpdate); }
public NotificationComment Delete(NotificationComment itemToDelete) { _context.NotificationComments.Remove(itemToDelete); _context.SaveChanges(); return(itemToDelete); }
public async Task <bool> HandleAsync(AddNotificationComment message) { NotificationComment comment = new NotificationComment(message.NotificationId, message.UserId, message.Comment, message.ShipmentNumber, message.DateAdded); return(await this.repository.Add(comment)); }