public LibraryMutation(ILibraryService libraryService, LibraryMessageService messageService)
 {
     FieldAsync <BookType>(
         name: "createBook",
         description: "",
         arguments: new QueryArguments(new QueryArgument <NonNullGraphType <BookInputType> > {
         Name = "book"
     }),
         resolve: async context =>
     {
         var book      = context.GetArgument <BookDto>("book");
         var addedBook = await libraryService.AddBookAsync(book);
         messageService.AddBookAddedMessage(addedBook);
         return(addedBook);
     });
 }
Example #2
0
        public async Task Post([FromBody] string value)
        {
            ILibraryService client = ServiceProxy.Create <ILibraryService>(new Uri("fabric:/SF.Example/SF.Library"));

            Guid Id = await client.AddBookAsync(new Book { Author = "test", Title = "test Title", Year = DateTime.Now.Year });
        }