How to access data from SQLite database using Dapper micro-ORM (In ASP.NET Core 3.1)
HTML-код
- Опубликовано: 1 авг 2020
- SQLite is a small, fast, full-featured SQL database engine, that is written in C. And it runs in the same process as the application itself. It is highly reliable and self-contained. In this video, I am going to walk through how to use SQLite with Dapper (a Micro-ORM).
Just like any other database, if we want to use the SQLite database engine from an ASP.NET Core application, we will need to work with either ADO.NET or an ORM Framework.
Dapper is a high-performance micro-ORM. and it is one of the easiest to use ORM framework in my opinion. It is built with extension methods on the IDBConnection interface. And it works with most of the popular RDBMS databases out there.
I have other videos on Dapper here for your reference: dotnetcorecentral.com/blog/as...
In this video, I will mainly cover, how to create and read data from an SQLite database using Dapper. And as a part of the process, I will show how to create a table in the SQLite process and discuss the concept of rowid in SQLite.
The blog post associated with this video is available here: dotnetcorecentral.com/blog/ho...
The source code for this blog post is available in GitHub repo here: github.com/choudhurynirjhar/s... - Наука
Very clear explanation! Thanks!
@Rafa Pioli, thanks for watching!
This is a GREAT video thank you very much
@Glenda Mabasa, thanks for watching!
Good video tutorial on dapper.
@AralHarv, thanks for watching!
Thank you!
@Doğukan Kurt, thanks for watching!
NICE!~
Glad you like it!
Do I still need to create the Product table if I dont want it in my database?
Like I want my application to read everything from the database nothing should be created in code
@Glenda Mabasa, some process needs to create data into the database, if the data already exists, yes you can just read the data, you do not have to create the data.
Can you please help me getting a single product based on id. I would be so greatful to you
@karan chadha, thanks for watching the video!
To access a single product based on id, you can use something like this:
connection
.QueryFirstOrDefaultAsync("Your Stored Procedure", new { productId }, commandType: CommandType.StoredProcedure);
I want the name of the program
I am not sure what exactly you wanted.