I'm trying to implement the Mediator and CQRS patterns with Syncfusion Datagrid, but whenever I try to use the mediator.Send method inside the CustomAdaptor Read method I get an error. Do you have a working example of getting the Medaitor and CQRS pattern to work with Datagrid?
Kind regards,
Andries
Hi Rahul,
I'm still creating the Clean Architecture solution with the Mediator and the CQRS patterns, and got much further since my last question. I've setup my Core Domain and Application projects, as well as my Infrastructure and Persistence layers, with my API accessing all the layers successfully and working properly when launched. I've created a MVC and Blazor User interface to test the difference. When I run my Blazor User Interface, as a test in the Index.razor page I'm accessing my API using the WebApiAdapter and viewing it with SfGrid. All the records load successfully, filtering, sorting and deleting works fine and I can add a new record to the database. The problems I cannot seem to solve are:
1) When I click on a record I get "An unhandled error has occurred" without "ActionFailure" even being called.
2) Also, probably related to (1) above, I cannot edit any record.
Please find the source code attached. A few notes on the source code:
1) Please ignore the Services folder under UI Blazor, as I at first thought that I need it as was the case with the MVC user interface to access the API, but only realised later that the API is accessed directly via the WebApiAdapter.
2) I've removed the MVC UI as it's not applicable to my query
3) To get the source code small enough, I've removed the .git and .vs folders as well as any Debug folders.
4) You can create and seed the database via the Persistence layer with "update-database -context CCASDbContext"
5) You can start the project using "Multiple startup projects" and starting both the Api and Blazor projects
I've managed to get it right. I'm still not sure what my mistake was, but I simply recreated the whole Clean Architecture from scratch, and this time all my CRUD actions work 100% using Syncfusion sfgrid. I still need to create more complex data structures where each Student have many Courses and each Course is taken by many students with the many to many link between the two being the Enrollments table containing the Student's Grade for each Course and displaying and updating this info using sfgrid dynamically (which is the whole reason I want to work with Blazor and Syncfusion). I'll contact you if I don't come right.