public async Task CreateBook() { // when Debugging is required, System.Diagnostics.Debugger.Launch(); var options = new DbContextOptionsBuilder <LibraryMaterialContext>() .UseInMemoryDatabase(databaseName: "BookStore") .Options; var context = new LibraryMaterialContext(options); var request = new Create.Execute(); request.Title = "Net Core Micro-services"; request.BookAuthorGuid = Guid.Empty; request.PublishDate = DateTime.Now; var handler = new Create.Handler(context); var result = await handler.Handle(request, new CancellationToken()); Assert.True(result != null); }
public async Task <ActionResult <Unit> > Insert(Create.Execute teacher) { return(await Mediator.Send(teacher)); }
public async Task <ActionResult <Unit> > Create(Create.Execute request) { return(await _mediator.Send(request)); }
public async Task <ActionResult <Unit> > Insert(Create.Execute comment) { return(await Mediator.Send(comment)); }