Beispiel #1
0
 public async Task SendEditComplete(EditReceiveDto edit)
 {
     // var food = await _context.Foods.FindAsync(edit.Id);
     // if(food == null)
     //     throw new Exception("Food is not present in the system");
     // food.EditField = null;
     // await _context.SaveChangesAsync();
     await Clients.Others.SendAsync("ReceiveEditComplete", edit);
 }
Beispiel #2
0
        public async Task SendEdit(EditReceiveDto edit)
        {
            var food = await _context.Foods.FindAsync(edit.Id);

            if (food == null)
            {
                throw new Exception("Food is not present in the system");
            }
            food.EditField = edit.Field;
            await _context.SaveChangesAsync();

            await Clients.Others.SendAsync("ReceiveEdit", edit);
        }
Beispiel #3
0
 public async Task SendEditComplete(EditReceiveDto edit)
 {
     await Clients.Others.SendAsync("ReceiveEditComplete", edit.Id);
 }