Please put your thoughts and feedback in the comments section.IDatabase db = new Database ( "connStringName " ) //v2 var users = db. Keep visiting this blog and share this in your network. If you are interested in Entity Framework Core, then read my series of posts about EF Core and loves Dapper.NET then read Use Dapper.NET With ASP.NET Core. It also supports transaction supports, mapping of nested objects, change tracking, Fluent based mapping and many other features. And the good thing is that it maps the results to Poco objects. Along with executing SQL queries, you can also use inbuit methods for CRUD operations. It’s really very easy to setup and use NPoco. Here is the video showing all Product API operations. Since the table is empty, so you should see following.Īnd now call the GET Product API again and you should see that product you just added is returned. Now, let’s just run the application and execute the GET API. This controller has methods for GET, POST, PUT and DELETE. ProductRepository = new ProductRepository() Private readonly ProductRepository productRepository Public class ProductController : Controller Now, lets create a new controller “ProductController.cs” as follows,
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |