public async Task <IActionResult> GetAllForProject(long id) { var applications = await _logic.GetAllForProject(id); if (applications == null) { return(NotFound("Ni jedan student se nije prijavio za ovaj projekat.")); } //var applicationsReturn = _mapper.Map<List<ApplicationForList>>(applications); //return Ok(applicationsReturn); return(Ok(applications)); }
public ApplicationQuery(IApplicationLogic applicationLogic) { FieldAsync <ApplicationType>( "applicationByIds", arguments: new QueryArguments(new QueryArgument <LongGraphType> { Name = "projectId" }, new QueryArgument <IntGraphType> { Name = "studentId" }), resolve: async context => { return(await applicationLogic.GetById(context.GetArgument <long>("projectId"), context.GetArgument <int>("studentId"))); } ); FieldAsync <ListGraphType <ApplicationType> >( "applicationsByProject", arguments: new QueryArguments(new QueryArgument <LongGraphType> { Name = "projectId" }), resolve: async context => { return(await applicationLogic.GetAllForProject(context.GetArgument <long>("projectId"))); } ); FieldAsync <ListGraphType <ApplicationType> >( "applicationsByProjectAccepted", arguments: new QueryArguments(new QueryArgument <LongGraphType> { Name = "projectId" }), resolve: async context => { return(await applicationLogic.GetAllForProjectAccepted(context.GetArgument <long>("projectId"))); } ); FieldAsync <ListGraphType <ApplicationType> >( "applicationsByCriteria", arguments: new QueryArguments(new QueryArgument <LongGraphType> { Name = "projectId" }, new QueryArgument <StringGraphType> { Name = "criteria" }), resolve: async context => { return(await applicationLogic.GetByCriteriaForProject(context.GetArgument <long>("projectId"), context.GetArgument <string>("criteria"))); } ); }
public ProjectType(IApplicationLogic applicationLogic, IProjectProposalLogic projectProposalLogic) { Field(x => x.ProjectID); Field(x => x.AdoptionDate); Field(x => x.Note); Field(x => x.Description); //Field<EmployeeType>("internalMentor", resolve: context => { return employeeLogic.GetByID(context.Source.InternalMentor.EmployeeID); }); //Field<EmployeeType>("decisionMaker", resolve: context => { return employeeLogic.GetByID(context.Source.DecisionMaker.EmployeeID); }); FieldAsync <ProjectProposalType>("projectProposal", resolve: async context => { return(await projectProposalLogic.GetByProjectId(context.Source.ProjectID)); }); FieldAsync <ListGraphType <ApplicationType> >("applications", resolve: async context => { return(await applicationLogic.GetAllForProject(context.Source.ProjectID)); }); }