public IActionResult Create([FromBody] string message) { var entity = new TestEntityModel { Message = message }; TestEntityRepository.Add(entity); TestEntityRepository.SaveChanges(); return(Json(new { entity.Id })); }
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 { })); }
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 { })); }
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 { })); }