CalvinSithideth / Project-Muscle

My CPTC portfolio project. A web forum/message board.
0 stars 0 forks source link

Design Database #12

Open CalvinSithideth opened 4 years ago

CalvinSithideth commented 4 years ago

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.

CalvinSithideth commented 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.

CalvinSithideth commented 4 years ago

Classes are designed in a forum branch

CalvinSithideth commented 4 years ago

Note: For EF to work, Class constructors for the models must be parameterless.

CalvinSithideth commented 4 years ago

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.

CalvinSithideth commented 4 years ago

This might be useful: https://docs.microsoft.com/en-us/aspnet/mvc/overview/getting-started/getting-started-with-ef-using-mvc/creating-a-more-complex-data-model-for-an-asp-net-mvc-application

CalvinSithideth commented 4 years ago

Lazy Loading: https://docs.microsoft.com/en-us/archive/msdn-magazine/2011/june/msdn-magazine-data-points-demystifying-entity-framework-strategies-loading-related-data

CalvinSithideth commented 4 years ago

Gonna try again with proper foreign keys on the classes

CalvinSithideth commented 4 years ago

Navigation properties: https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/navigation-property

CalvinSithideth commented 4 years ago

EF Core Relationships - Fluent API https://docs.microsoft.com/en-us/ef/core/modeling/relationships#fluent-api

CalvinSithideth commented 4 years ago

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.

CalvinSithideth commented 4 years ago

Data Access specific MSDOCS: https://docs.microsoft.com/en-us/aspnet/core/data/ef-mvc/crud?view=aspnetcore-3.0