コード例 #1
0
        public NotificationComment Create(NotificationComment itemToCreate)
        {
            var comment = _context.NotificationComments.Add(itemToCreate);

            _context.SaveChanges();
            return(comment);
        }
コード例 #2
0
        public async Task <bool> Add(NotificationComment comment)
        {
            context.NotificationComments.Add(comment);
            await context.SaveChangesAsync();

            return(true);
        }
コード例 #3
0
 public NotificationComment Update(NotificationComment itemToUpdate)
 {
     _context.Entry(itemToUpdate).State = EntityState.Modified;
     _context.SaveChanges();
     return(itemToUpdate);
 }
コード例 #4
0
 public NotificationComment Delete(NotificationComment itemToDelete)
 {
     _context.NotificationComments.Remove(itemToDelete);
     _context.SaveChanges();
     return(itemToDelete);
 }
コード例 #5
0
        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));
        }