Open CalvinSithideth opened 4 years ago
A "hard-design" isn't as important at first with a code-first migration. We can add and edit as we go along.
Classes are designed in a forum branch
Note: For EF to work, Class constructors for the models must be parameterless.
Getting a little complicated trying to get boards, threads, and posts working all at once with the Entity Framework. Might have to scrap this and take a 'database first' approach.
Gonna try again with proper foreign keys on the classes
Navigation properties: https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/navigation-property
EF Core Relationships - Fluent API https://docs.microsoft.com/en-us/ef/core/modeling/relationships#fluent-api
So the way this is laid out, scaffolding is not an option, unless using generated code as a reference. The forum controller and database context will require a custom solution.
Data Access specific MSDOCS: https://docs.microsoft.com/en-us/aspnet/core/data/ef-mvc/crud?view=aspnetcore-3.0
Database should be designed using a tool such as Visio, in order to use as a reference for coding the actual database.
At a minimum, the database should have the following tables or entities:
With posts handling the most detailed information.
ASP.NET Identity handles the start of user authentication. The two databases may be merged.