A simple introduction to SQL+ Dot Net


Explained the SQL+.Net with a sample project and its steps.



             SQL+.Net is the ORM for C# and SQL designed to complement the skills of SQL developers. By simply adding comments to your SQL you can generate an object oriented class library with good performance.

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:

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

  • 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

11. Output


 https://www.sqlplus.net/

Comments

Popular posts from this blog

Access tokens for several web api from one Angular application

Azure Front Door - Path based routing rule

Azure SQL load balance consideration