CodedThought.Core.Data.SqlServer 10.0.1.4

dotnet add package CodedThought.Core.Data.SqlServer --version 10.0.1.4
                    
NuGet\Install-Package CodedThought.Core.Data.SqlServer -Version 10.0.1.4
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CodedThought.Core.Data.SqlServer" Version="10.0.1.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CodedThought.Core.Data.SqlServer" Version="10.0.1.4" />
                    
Directory.Packages.props
<PackageReference Include="CodedThought.Core.Data.SqlServer" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add CodedThought.Core.Data.SqlServer --version 10.0.1.4
                    
#r "nuget: CodedThought.Core.Data.SqlServer, 10.0.1.4"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package CodedThought.Core.Data.SqlServer@10.0.1.4
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=CodedThought.Core.Data.SqlServer&version=10.0.1.4
                    
Install as a Cake Addin
#tool nuget:?package=CodedThought.Core.Data.SqlServer&version=10.0.1.4
                    
Install as a Cake Tool

CodedThought.Core.Data.SqlServer

A .NET Core Data Entity Provider for Sql Server.

Requirements

SqlServer requires CodedThough.Core.Configuration and CodedThought.Core. These can be found in NuGet. - CodedThought.Core.Configuration - CodedThought.Core

Usage

  1. Install required packages. See requirements above.
  2. Add the Database Connection settings in the appSetting.json or a custom .json file.

    Note: See CodedThought.Core.Configuration for JSON configguration specifications.

  3. Add a new class and inherit from CodedThough.Core.Data.GenericDataStoreController. Below is a sample class file.
    using CodedThought.Core;
    using CodedThought.Core.Data;
    public class DataController : GenericDataStoreController {

		public DataController(IMemoryCache cache, CodedThought.Core.Configuration.ConnectionSetting	 connectionSetting	) {
			DataStore = new GenericDataStore(cache, connectionSetting, "dbo");
		}

		public Person GetPerson(string email)
		{
			try
			{
				ParameterCollection param = DataStore.CreateParameterCollection();
				param.AddStringParameter("EmailAddress", email);
				return DataStore.Get<Person>(param);
			} catch (Exception)
			{

				throw;
			}
		}
            
        public List<Person> GetPeople() {
            try {
                return DataStore.GetMultiple<Person>(null);
            } catch {
                throw;
            }
        }
    }
    using System.Data;
    using CodedThought.Core;
    using CodedThought.Core.Data;
	///<summary>
	/// Person class used by the framework to locate the right table and columns with class and proprety annotations.
	///</summary>
	[DataTable("tblPeople")]
	public class Person
	{
		public Person() { }
		[DataColumn("EmailAddress", DbType.String, DataColumnOptions.PrimaryKey)]
		public string EmailAddress { get; set; }
        [DataColumn("FirstName", DbType.String)]
		public string FirstName { get; set; }
		[DataColumn("LastName", DbType.String)]
		public string LastName { get; set; }
	}

Release Notes

10.0.1.4

Feature Description & Remarks
Fewer round trips on writes Add no longer wraps its statement in an explicit transaction, cutting an insert from 3 network round trips to 1.
Reads preserve the caller's transaction Get no longer commits in a finally. It never opened a transaction, so it no longer closes one.
.NET 10 The provider now targets net10.0, matching CodedThought.Core 10.0.1.4.
Microsoft.Data.SqlClient 7.1.1 Updated from 6.0.2 to align with CodedThought.Core and clear the NU1605 downgrade warning.
Write Path Performance

Both paths in Add issue a single statement, and the identity path batches the INSERT with SELECT SCOPE_IDENTITY() into one command, so each was already atomic. The surrounding BEGIN TRANSACTION and COMMIT TRANSACTION added two network round trips without adding safety. Exception translation is unchanged.

Measured against a remote SQL Server where one round trip cost approximately 45.5 ms, averaged over interleaved A/B passes of 30 iterations:

Operation Before After Round Trips
Insert 135 ms 46 ms 3 to 1
Delete 133 ms 45 ms 3 to 1
Update 179 ms 91 ms 4 to 2

Note: These figures are specific to a high-latency connection. The improvement is a reduction in round trips, so the benefit shrinks as server latency approaches zero. Reads were already efficient and are unchanged.

Remove and Update are not overridden by this provider, so their improvement comes from the matching change in CodedThought.Core 10.0.1.4. The Update gain depends on the Get fix above, because a read before a write used to commit the caller's transaction and force the following write to open a new one.

Upgrade Notes

Code that relied on Add or Get implicitly committing an open transaction must now commit explicitly.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
10.0.1.4 34 10/21/2026
8.0.1.6 224 4/27/2026
8.0.1.5 319 6/17/2025
8.0.1.4 261 6/17/2025
8.0.1.1 247 12/11/2024
8.0.1 255 11/20/2024
8.0.0-beta-7 184 11/6/2024
8.0.0-beta-6 413 6/3/2024
8.0.0-beta-5 212 5/30/2024
8.0.0-beta-4 216 5/30/2024
8.0.0-beta-3 207 5/30/2024
8.0.0-beta-2 212 5/30/2024
8.0.0-beta-1 215 5/29/2024
8.0.0-alpha-7 217 5/17/2024
Loading failed

Updated to use new Add override that allows passing the schema in and will use the default schema is not passed in and is available.