public Api.Model.Purpose Execute(Api.Model.Purpose request)
        {
            PurposePersistModel record = _context.Purposes.Find(request.Id);

            record.Name = request.Name;
            _context.SaveChanges();
            request.Id = record.Id;
            return(request);
        }
Esempio n. 2
0
        public Api.Model.Purpose Execute(Api.Model.Purpose request)
        {
            PurposePersistModel record = _context.Purposes.Find(request.Id);

            record.Disabled    = true;
            record.DisableDate = DateTime.Now;
            _context.SaveChanges();
            request.Id = record.Id;
            return(request);
        }
        public Api.Model.Purpose Execute(Api.Model.Purpose request)
        {
            var record = new PurposePersistModel()
            {
                Name = request.Name
            };

            _context.Purposes.Add(record);
            _context.SaveChanges();
            request.Id = record.Id;
            return(request);
        }