You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a developer clones the project, only connection string (or other few configs) should be set.
Then by running the application, initial seed data should be inserted to the DB:
Site for localhost
User
Role
A few Pages (About Us, Contact Us, etc.)
The above objects should be read from json files which exist in the project's source files (like SeedData/user.json).
It is not preferred to hard-code the initial/default objects' properties in the C# code.
So, in the first request we should check if any Site records exists or not.
If not, it should read the site.json and insert to DB, then user.json, role.json, etc.
When a developer clones the project, only connection string (or other few configs) should be set.
Then by running the application, initial seed data should be inserted to the DB:
The above objects should be read from json files which exist in the project's source files (like SeedData/user.json).
It is not preferred to hard-code the initial/default objects' properties in the C# code.
So, in the first request we should check if any Site records exists or not.
If not, it should read the site.json and insert to DB, then user.json, role.json, etc.
Here is a draft hard-coded seed data implementation:
https://github.com/ubeac/ubeac-cms/blob/main/uBeacCMS.Web/SeedData.cs
And the usage in
program.cs
:app.Services.SeedDefaultData();
The text was updated successfully, but these errors were encountered: