Mediator and CQRS patterns with Syncfusion Datagrid

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


4 Replies

RN Rahul Narayanasamy Syncfusion Team October 26, 2021 03:52 AM UTC

Hi Andries, 

Greetings from Syncfusion.  

We are currently checking this from our side. In the meantime, could you please share with us the following details for better assistance. It will be helpful to validate and provide a better solution. 

  • Share the exception error details.
  • Bind OnActionFailure event to grid, and share the details you get in the args of this event handler.
  • Full code snippets.
  • Syncfusion Blazor NuGet version details.
  • Share a simple reproduceable sample which you have tried at your end.
 
Regards, 
Rahul 



AV Andries van Tonder replied to Rahul Narayanasamy December 14, 2021 09:40 PM UTC

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


Attachment: CCASForum_797e23ee.zip


AV Andries van Tonder replied to Andries van Tonder December 15, 2021 09:35 PM UTC

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.





RN Rahul Narayanasamy Syncfusion Team December 16, 2021 03:47 AM UTC

Hi Andries, 

Thanks for the update. 
 
Query: When I click on a record I get "An unhandled error has occurred" without "ActionFailure" even being called. 

We have validated your query with the provided details. We have already have a known issue while selecting the record in 19.3.0.57 version. The problem was already included in our latest patch release – in 19.3.0.59 version. We suggest you to update the Syncfusion NuGet to the latest version(v19.3.0.59) to resolve the reported problem. 

We are happy to hear that you have resolved the reported problem by yourself. 

Please get back to us if you have any other queries. 


Regards, 
Rahul 
 


Loader.
Up arrow icon