I received compiler errors associated with naming when adding a data source and scaffolding to a new project. Repro info:
Project Type: Blazor Web App (Auto)
.NET Version: .NET 9
Steps:
- Create a brand new project
- Create a DB with a hyphenated db name. e.g. myapp-dev
- Add a Radzen data source
- Continue to add DB tables
- Continue to add scaffolding to all tables
- On the settings page, set the name to MyAppDB
- Generate
Here are the errors I saw and how I resolved them.
- Radzen used "myapp-dev" as a class name for services. Looking at the types, I figured out they were meant to be the Radzen generated type MyAppDBService. Refactored and it worked.
- Fully qualified type names for Models were MyBlazorApp.Server...myapp-dev... So I factored that out and added global usings for the namespace since it was being used everywhere - for both the Client and Server.
- I had selected a stored procedure for performing a custom deletion action, DeleteMyModelProc(int id). Radzen seemed to create a CRUD abstraction around that. However, the generated code dotted into methods that were not generated. I commented those out and everything compiled.
I'm supposing that Some of this wouldn't have happened if I had named my DB MyAppDB. However, we often don't get that choice for legacy DBs or those in large orgs where the Databases and other infrastructure are managed outside of the software development business function. On the stored proc, I guessing that there's a pattern to follow, but again, we often don't have those choices available.
Once I got it working, it was very nice to work with and use. I can see how useful this can be.