public async Task <IActionResult> GetPhaseById(int id) { var get = await _phaseLogic.GetById(id); if (get == null) { return(NotFound()); } return(Ok(get)); }
public async Task <IActionResult> Get(int id) { var phase = await _logic.GetById(id); if (phase == null) { return(NotFound()); } return(Ok(phase)); }
public async void Get_Phase_By_Id_Valid_Input_Integration() { var phase = new PhaseDTO { Id = 0, Purpose = "something", DisplayFields = null, Participants = null, InputFields = null, TaskDelegations = null, IsAutomatic = false, ConflictManager = null, OverlapPercentage = 10 }; var result = await _phaseLogic.GetById(phase.Id); Assert.Equal(phase, result); Assert.Equal(phase.Purpose, result.Purpose); }
public EngagementType(IStudentLogic studentLogic, IPhaseLogic phaseLogic) { Field(x => x.ProjectID); Field(x => x.StudentID); Field(x => x.DocumentID); Field(x => x.Description); Field(x => x.Name); Field(x => x.PhaseID); FieldAsync <StudentType>("student", resolve: async context => { return(await studentLogic.GetById(context.Source.StudentID)); }); FieldAsync <PhaseType>("phase", resolve: async context => { return(await phaseLogic.GetById(context.Source.PhaseID)); }); }
public void Get_Phase_By_Id_Valid_Input() { var phase = new PhaseDTO { Id = 0, Purpose = "something", DisplayFields = null, Participants = null, InputFields = null, TaskDelegations = null, IsAutomatic = false, ConflictManager = null, OverlapPercentage = 10 }; _phaseDtoRepository.Setup(a => a.ReadAsync(It.IsAny <int>())).ReturnsAsync(phase); var result = _phaseLogic.GetById(phase.Id).Result; Assert.Equal(phase, result); Assert.Equal(phase.Purpose, result.Purpose); }
public PhaseQuery(IPhaseLogic phaseLogic) { FieldAsync <PhaseType>( "phasetById", arguments: new QueryArguments(new QueryArgument <IntGraphType> { Name = "id" }), resolve: async context => { return(await phaseLogic.GetById(context.GetArgument <int>("id"))); } ); FieldAsync <ListGraphType <PhaseType> >( "phasesByProjectPlan", arguments: new QueryArguments(new QueryArgument <LongGraphType> { Name = "projectPlanId" }), resolve: async context => { return(await phaseLogic.GetByProjectPlan(context.GetArgument <long>("projectPlanId"))); } ); }