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); }
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); }
public async Task SendEditComplete(EditReceiveDto edit) { await Clients.Others.SendAsync("ReceiveEditComplete", edit.Id); }