A simple introduction to SQL+ Dot Net
Explained the SQL+.Net with a sample project and its steps.
Here is the performance comparison by sqlservercentral.com
Dapper Insert 1000 Records:3364
EF Insert 1000 Records:12794
SQL Plus Insert 1000 Records:2316
Here I have created a console application with sample SQL+ .net ORM utilization.
Prerequisites:
- Visual studio 2017/2019
- SQL+.Net Extension – Download the extension in the link - https://marketplace.visualstudio.com/items?itemName=AHHSoftware.SQLPlusCodeGenerationUtilityDotNetFrameworkVersion1
1. Create a database project
- Create a table
- Stored procedures for insert and select
2. We need to add comments for Stored procedures to help SQL+ to generate an OO library
--+SqlPlusRoutine--&SelectType=NonQuery or SingleRow or MultiRow or JSON or XML or MultiSet
--&Comment=Comment
--&Author=Author
--+SqlPlusRoutine
- Insert
- --+SqlPlusRoutine
- --&SelectType=NonQuery
- --&Comment=Add a new book
- --&Author=Vivekkumar
- --+SqlPlusRoutine
- Select
- --+SqlPlusRoutine
- --&SelectType=SingleRow
- --&Comment=Get a book
- --&Author=Vivekkumar
- --+SqlPlusRoutine
3. Publish the database – Here I used Azure SQL V12
4. Create a .net core console application
5. Right click on the console application project and select SQL+ .Net Build, this will create the configuration files for you
4. Create a .net core console application
- Install System.Data.SqlClient
5. Right click on the console application project and select SQL+ .Net Build, this will create the configuration files for you
6. DatabaseConnection.json – provide the connection string and your json will look like this
7. BuildDefinition.json – here we configure the build schema with DB schema, namespace for the class object and remove all other configurations as like this
8. Again build you project with SQL+, now all the class libraries will be generated by SQL+
9. For Insert
10. For Select
7. BuildDefinition.json – here we configure the build schema with DB schema, namespace for the class object and remove all other configurations as like this
8. Again build you project with SQL+, now all the class libraries will be generated by SQL+
9. For Insert
10. For Select
https://www.sqlplus.net/







Comments
Post a Comment