When working with SQL Server in a Microsoft .NET application, I want to stay focused on solving the business challenge at hand; I want to spend as little time as possible writing the plumbing to accomplish needed work with the database. I finally found an amazing tool that does just that! This is the first of a series of blog posts to show just how easy and productive database interactions in Microsoft C#.
Over the years I have worked with Entity Framework (EF) and other ORMs such as Dapper, NHibernate, EntitySpaces.NET, LLBLGen Pro, and in it's heyday, my previous favorite, LINQ to SQL. I don't want to get into an argument whether these are true ORMs or not - I am using the term ORM loosely to mean any software tool or library that allows me to accomplish tasks in code with SQL Server without writing ADO.NET that utilizes datasets and data tables.
I was really disappointed when LINQ to SQL was discontinued in favor of Entity Framework. It was simple and intuitive. I know that many developers use EF on a regular basis and may be happy with it but I have always found it difficult to use. Perhaps you have struggled with it too; I certainly hope I am not the only one. 😔
Most developers that work with SQL Server use tools like SQL Server Management Studio (SSMS) or Visual Studio Code to write and test their queries before placing them in code. What if that was (almost) all you had to do to get that query to run in your application?
This is where SQL+.NET shines! I can take the T-SQL statement I have just written, add some annotations as comments to the T-SQL statements, place that T-SQL in my .NET project as a .sql file, and then in one step generate all the code I need to call it and send the inputs and receive the status and results as strongly-typed .NET objects. In my next post, I will show just how easy it is. I think you will be pleasantly surprised.
Hope that helps.
Hope that helps.
Joe