There are other ways to connect to database with Blazor in addition to Entity Framework Core?

jos3m 1 Reputation point
2021-08-09T06:29:53.073+00:00

I work with WebForms currently and all the access to SQL Server database is based on stored procedures to CRUD operations with SqlCommand and CommandType.StoredProcedure. I do not 'select' the database directly.
All I am reading about Blazor references Entity Framework which converts every item of the database into a component, but there are alternative methods for accessing to database?

Thanks in advance

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
705 questions
Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
1,429 questions
SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,928 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Fei Han - MSFT 306 Reputation points Microsoft Vendor
    2021-08-14T02:34:18.963+00:00

    all the access to SQL Server database is based on stored procedures to CRUD operations with SqlCommand and CommandType.StoredProcedure.

    Hi @jos3m , if you are familiar with using ADO.NET such SqlConnection, SqlCommand ect object to access SQL DB, you can achieve same by installing and using Microsoft.Data.SqlClient to access your existing SQL Server database in ASP.NET Core project.

    Besides, please note that Entity Framework Core also allows us to execute stored procedure(s) or raw SQL queries. For more information, you can check this doc:

    https://learn.microsoft.com/en-us/ef/core/querying/raw-sql

    0 comments No comments