Пример #1
0
 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> Post([FromBody] Application app)
 {
     if (!await _logic.Insert(app))
     {
         return(BadRequest("Neuspesno sacuvana prijava."));
     }
     return(Ok());
 }