Exemple #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());
        }
Exemple #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());
        }
 public async Task Update(T value)
 {
     await _manager.Update(value);
 }