In ASP.NET core by default logged in user’s email is shown in header after login.

We can show any other information like First or Last Name or even full name (by combining these two).

To achieve this we need to make the following changes:

Customize your Identity User

Customize the identity user and identity role (if needed) as shown below:

 public class ApplicationUser: IdentityUser<int>
 ...  read more

In previous articles Get enumeration items as a list in C# and Populate dropdown with enumeration items in ASP.NET Core we that saw how to get enumeration items as a collection to bind it to data controls like dropdown etc.
In this article we will see that how can we get the description given as an attribute with an item. We may need this information on various places, say we have listing of users and we need to show each user’s status but in a descriptive way.

Here is our example enumeration:

  enum UserStatus
        [Description("Pending Verification")]
 ...  read more

Sometime we need to fetch the information about the tables defined in an SQL Server database, we can fetch this information using the following query:

SELECT * FROM sys.tables

It will show information about all the tables in database.

You can use the following query to get the count number of tables in the database:

SELECT count(*) FROM sys.tables

Use the following query to get matching table names:

 ...  read more