Before we start creating our POCO entities, let's try to visualize the database that we will need to implement the previously mentioned features. First, let's have tables that will cater to user registration, authentication and authorization mechanism. We can create the following three tables to accomplish this task:
Users: This table will keep all the users' information that is needed for the users to log in and manage their account.
Roles: This table will keep track of the roles within our application. In our application, we will have two roles:
Authors
andUsers
.Authors
will be able to post blogs and manage them.Users
will only be able to post comments on blogs.UserRoles: This is a simple joining table that will be created to facilitate many-to-many relationships between users and roles.
Now that we have the basic authentication and authorization tables in place, let's see what tables are needed to implement our application-specific features. The following...