How To

Database Schema Modifications in EF Core
By Tan Lee Published on Feb 06, 2025 97

Whenever a database’s structure changes, whether you’re renaming a column or adding a new table, it’s called a database schema modification. With EF Core, these changes are managed through migrations.

Adding a Computed Column in EF Core
By Tan Lee Published on Feb 06, 2025 161

To add a computed column in EF Core, override DbContext.OnModelCreating() and use the ModelBuilder to define the computed column.

Inheritance Mapping in EF Core
By Tan Lee Published on Feb 06, 2025 126

In EF Core, inheritance can be mapped in two main ways:

Adding a Foreign Key in EF Core
By Tan Lee Published on Feb 06, 2025 217

In Entity Framework Core (EF Core), adding a foreign key involves creating a relationship between two entities (tables). You can define the foreign key either through data annotations in your model class or by using the Fluent API in your DbContext.

How to create a composite primary key in EF Core
By Tan Lee Published on Mar 07, 2025 90

A composite primary key is a primary key consisting of more than one column.

How to use GROUP BY in SQL
By Tan Lee Published on Mar 07, 2025 133

You can use the GROUP BY clause in SQL to organize rows based on one or more columns. This creates a single row per group in the result, where each group contains the columns used for grouping and the aggregated results of functions like COUNT, MIN, MAX, AVG, or SUM.

Filtering GROUP BY with HAVING and WHERE in SQL
By Tan Lee Published on Mar 07, 2025 166

In SQL, you can filter the results of a GROUP BY query in two ways:

Using GROUP BY with ORDER BY in SQL
By Tan Lee Published on Mar 07, 2025 185

The GROUP BY clause groups rows based on one or more columns, while the ORDER BY clause sorts rows. You can combine these two to sort the groups themselves.

How to change progress bar color in html
By Tan Lee Published on Mar 14, 2024 459

To change the color of a progress bar in HTML, you can use CSS.

Aggregate functions with GROUP BY in SQL
By Tan Lee Published on Mar 07, 2025 239

In SQL, there are five primary aggregate functions: COUNT(), SUM(), AVG(), MIN(), and MAX(). These functions calculate summary values for sets of rows. When used with the GROUP BY clause, they generate summary values for each group.

How to Copy data from one table to another in SQL
By Tan Lee Published on Mar 07, 2025 286

To copy data from one table to another, you can use the INSERT INTO SELECT statement with a column list:

JSON object contains a trailing comma at the end which is not supported
By Tan Lee Published on Mar 07, 2025 205

To fix the error 'JSON object contains a trailing comma at the end which is not supported', you need to modify your JSON and/or the deserialization settings.