示例#1
0
 public static async Task UpdateChannelMessage(this AppDbContext db, ChannelMessage message)
 {
     if (message.Validate())
     {
         db.ChannelMessages.Update(message);
         await db.SaveChangesAsync();
     }
 }
示例#2
0
        public static async Task AddChannelMessage(this AppDbContext db, ChannelMessage message)
        {
            if (message.Validate())
            {
                message.MessageDate = DateTime.Now;
                await db.ChannelMessages.AddAsync(message);

                await db.SaveChangesAsync();
            }
        }