Example #1
0
        public async Task WriteMessage(int dialogId, Message message)
        {
            var dialog = await db.Dialogs.FindAsync(dialogId);

            if (dialog != null)
            {
                db.Entry(dialog).Collection(r => r.Messages).Load();
                dialog.Messages.Add(message);
                await db.SaveChangesAsync();
            }
        }
Example #2
0
 public async Task Update(File file)
 {
     db.Entry(file).State = EntityState.Modified;
     await db.SaveChangesAsync();
 }