示例#1
0
        public IActionResult Create([FromBody] string message)
        {
            var entity = new TestEntityModel
            {
                Message = message
            };

            TestEntityRepository.Add(entity);
            TestEntityRepository.SaveChanges();

            return(Json(new { entity.Id }));
        }
示例#2
0
        public IActionResult StepOne(long entityId)
        {
            var entity = TestEntityRepository.GetById(entityId);
            var change = StateChangeFactory.CreateChange(typeof(OneToTwoChange)) as OneToTwoChange;

            change.SetEntity(entity);

            StateManagger.ManageTransition(change, TestEntityStates.SecondPlace);
            TestEntityRepository.SaveChanges();

            return(Json(new { }));
        }
示例#3
0
        public IActionResult StepFour(long entityId, [FromBody] FourToFiveVM fourToFiveVM)
        {
            var entity = TestEntityRepository.GetById(entityId);
            var change = StateChangeFactory.CreateChange(typeof(FourToFiveChange)) as FourToFiveChange;

            change.SetEntity(entity);

            StateManagger.ManageTransition(change, TestEntityStates.FifthPlace, fourToFiveVM);
            TestEntityRepository.SaveChanges();

            return(Json(new { }));
        }
示例#4
0
        public IActionResult StepThree(long entityId)
        {
            var entity = TestEntityRepository.GetById(entityId);
            var change = StateChangeFactory.CreateChange(typeof(ThreeToFourChange)) as ThreeToFourChange;

            change.SetEntity(entity);
            change.SetPreviousStep(typeof(TwoToThreeChange).FullName);

            StateManagger.ManageTransition <TestEntityModel, TestEntityStates, BasicTask, BasicTaskAcl>(change, TestEntityStates.FourthPlace, secureBasicTaskRepository);
            TestEntityRepository.SaveChanges();

            return(Json(new { }));
        }