示例#1
0
        public async Task <IActionResult> Update([FromBody] TEntity entity)
        {
            await Task.Run(() => _service.Update <TEntity>(entity));

            // await _hubContext.Clients.Group(_tableName).SendAsync(_clientMethod, new { Action = "Update", Record = entity });
            return(_GetEntityResult(entity));
        }
示例#2
0
 // Update an entity to DB
 public async Task Update(TEntity entity)
 {
     _clientMethod = "Updated";
     try
     {
         _service.Update <TEntity>(entity);
         // if everything is ok, return the full obj with all inserted values
         await Clients.All.SendAsync(_clientMethod, new Response <TEntity>() { Data = entity });
     }
     catch (Exception ex)
     {
         await Clients.All.SendAsync(_clientMethod, new Response <Exception>() { Exception = ex });
     }
 }