Пример #1
0
        public ResponceModel <Req> PatchOne <Req>(RequestModel <Req> request) where Req : class, IValidate, IPK
        {
            var responce = CheckRequest(request);

            if (responce != null)
            {
                return(responce);
            }

            var element = _store.Find <Req>(request.Content.ID);

            if (element == null)
            {
                return(new ResponceModel <Req>().RecordNotFound());
            }

            element.CopyAllFrom(request.Content);

            _store.SaveChanges();

            return(new ResponceModel <Req> {
                content = element
            });
        }