Пример #1
0
        protected async Task <IActionResult> PatchAsync(string id, JsonPatchDocument <TContract> document)
        {
            var item = await AdminStore.GetAsync(id);

            if (item == null)
            {
                return(NotFound());
            }

            var contract = AdminMapper.Map <TContract>(item);

            document.ApplyTo(contract);

            AdminMapper.Map(contract, item);

            await AdminStore.SaveAsync(item);

            return(Ok(item));
        }