예제 #1
0
        public ResponceModel <Req> DeleteOne <Req>(string authKey, int id) where Req : class, IValidate, IPK
        {
            var responce = _userHelper.IsUserAutorized <Req>(authKey);

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

            var element = _store.Find <Req>(id);

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

            _store.Remove(element);
            _store.SaveChanges();

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