VSProject.SQLContext 5.2.1

dotnet add package VSProject.SQLContext --version 5.2.1
                    
NuGet\Install-Package VSProject.SQLContext -Version 5.2.1
                    
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="VSProject.SQLContext" Version="5.2.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="VSProject.SQLContext" Version="5.2.1" />
                    
Directory.Packages.props
<PackageReference Include="VSProject.SQLContext" />
                    
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 VSProject.SQLContext --version 5.2.1
                    
#r "nuget: VSProject.SQLContext, 5.2.1"
                    
#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.
#addin nuget:?package=VSProject.SQLContext&version=5.2.1
                    
Install VSProject.SQLContext as a Cake Addin
#tool nuget:?package=VSProject.SQLContext&version=5.2.1
                    
Install VSProject.SQLContext as a Cake Tool

What is it?

SQL Context it is microORM for easy mapping your sql queries to VB and C# classes. The library has some special features that provide the flexibility to configure the mapping:

  • Custom attributes (PrimaryKey, Table, Column). Table, Column - allows you to map property names to different column names
  • Mapping to .NET types, such as classes, structures and value types
  • Mapping to dynamic objects
  • Caching mapper functions for optimizing speed work
  • The architecture is based on an interface IDbConnection, that redesign library to connect any ADO.NET data provider

How I can use ?

Example code

Define your class for table row

	<Table("table_test")>
	Public Class ClassTest

	    <PrimaryKey>
	    Public Property ID As Long

	    <Column("field_name")>
	    Public Property Name As String

	    <Column("field_address")>
	    Public Property Address As String

		' This is custom user property
	    Public Property Phone As PhoneObject

		' This is custom user property
	    Public Property Skype As PhoneObject

	End Class

Connect to database and get each row in object class

	Using context As New SQLContext(New SQLiteConnection("Data Source=C:\test.db"))

	    ' You can read row as object class
	    
	    For Each row In context.SelectRows(Of ClassTest)("select id, field_name, field_address from table_test")
		Console.WriteLine($"Your record data is {row.ID}, {row.Name}, {row.Address}")	
	    Next
	    
	    ' Or you can read as Dictionary(Of String, Object)
	    
	    For Each row In context.SelectRows("select id, field_name, field_address from table_test")
		Console.WriteLine($"Your record data is {row("id")}, {row("field_name")}, {row("field_address")}")	
	    Next

	    ' Or you can read as dynamic object
	    For Each row In context.SelectRowsDynamic("select id, field_name, field_address from table_test")
		Console.WriteLine($"Your record data is {row.id}, {row.field_name}, {row.field_address}")	
	    Next
	    
	    ' Or do you have full control?
	    Dim reader = context.ExecuteReader("select id, field_name, field_address from table_test")
	    
	End Using
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.

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
5.2.1 134 5/5/2025
5.2.0 125 4/12/2025
5.1.0 136 7/31/2024
5.0.0 88 7/29/2024
4.0.0 862 4/3/2022
3.5.0 886 12/26/2020
3.3.0 820 8/3/2020
3.1.0 897 7/26/2020
3.0.1 861 7/23/2020
3.0.0 1,763 7/23/2020
2.3.0 2,493 9/29/2015

* Обновленный интерфейс мапперов, переосмыслена реализация
* Исправление ошибок и увеличение производительности в разы
* Удалены классы которые устарели и должны реализовываться пользователем
* Новый интерфейс для параметризации запросов (словарный тип или анонимный объект)

Большое количество примеров доступно в проекте NUnitAutoTest