public ApplicationMutation(IApplicationLogic applicationLogic) { FieldAsync <BooleanGraphType>( "addApplication", arguments: new QueryArguments(new QueryArgument <ApplicationInputType> { Name = "app" }), resolve: async context => { return(await applicationLogic.Insert(context.GetArgument <Application>("app"))); } ); FieldAsync <BooleanGraphType>( "editApplication", arguments: new QueryArguments(new QueryArgument <ApplicationInputType> { Name = "app" }), resolve: async context => { return(await applicationLogic.Update(context.GetArgument <Application>("app"))); } ); FieldAsync <BooleanGraphType>( "deleteApplication", arguments: new QueryArguments(new QueryArgument <ApplicationInputType> { Name = "app" }), resolve: async context => { return(await applicationLogic.Delete(context.GetArgument <Application>("app"))); } ); }
public async Task <IActionResult> Delete(long projectId, int studentId) { var applicationForDelete = await _logic.GetById(projectId, studentId); if (applicationForDelete == null) { return(NotFound()); } if (!await _logic.Delete(applicationForDelete)) { return(BadRequest()); } return(Ok()); }