Ejemplo n.º 1
0
        public static async Task <ActionResult> Update <T, TKey>(this Controller controller, ICRUDManager <T, TKey> manager, TKey idFromUri, TKey idFromValue, T value)
            where T : class where TKey : IComparable
        {
            if (idFromUri.CompareTo(idFromValue) != 0)
            {
                return(controller.BadRequest("Mismatch between id and dto.Id"));
            }

            await manager.Update(value);

            return(controller.NoContent());
        }
Ejemplo n.º 2
0
        public static async Task <ActionResult> Update <T, TKey>(this Controller controller, ICRUDManager <T, TKey> manager, IEnumerable <T> values) where T : class where TKey : IComparable
        {
            await manager.Update(values);

            return(controller.NoContent());
        }
Ejemplo n.º 3
0
 public async Task Update(T value)
 {
     await _manager.Update(value);
 }