QuickDBS.SQLServer 1.0.3.4

dotnet add package QuickDBS.SQLServer --version 1.0.3.4
NuGet\Install-Package QuickDBS.SQLServer -Version 1.0.3.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="QuickDBS.SQLServer" Version="1.0.3.4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add QuickDBS.SQLServer --version 1.0.3.4
#r "nuget: QuickDBS.SQLServer, 1.0.3.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.
// Install QuickDBS.SQLServer as a Cake Addin
#addin nuget:?package=QuickDBS.SQLServer&version=1.0.3.4

// Install QuickDBS.SQLServer as a Cake Tool
#tool nuget:?package=QuickDBS.SQLServer&version=1.0.3.4

SQL Server example

To open SQL Server connection to the database directly. The following code connects to the default SQLExpress instance with Trusted Connection and to the database databaseName. You could provide the complete connection string instead of just database name, in case you need to connect to remote machine or require secure connection with username and password.

var db = new QuickDBS.SQLServer("databaseName");

or

string connectionString = "Server=SERVERNAME; Database=SOMEDATABASENAME; User=USERNAME; Password=PASSWORD";
var db = new QuickDBS.SQLServer(connectionString);

Create a table from a Person class. The result will be true if created and false if failed or not-created.

public class Person
{
    public Int64 Id { get; set; }
    public string Name { get; set; }
    public double Income { get; set; }
    public DateTime DateOfBirth { get; set; }
}

var result = db.CreateTable<Person>();

Create a Person record in the Person table create above. The result will be the last insert Id of the table which will be unique.

var id = db.Create<Person>(new Person {
  Name = "Rahul",
  Income = 5000,
  DateOfBirth = new DateTime(2000, 01, 01)
});

Get the person record having Id = 1 from the Person table.

var person = db.GetById<Person>(1);
person.Name = "Rahul Hadgal";
person.Income = 10000;

Update the income for person selected in the above example, from 5000 to 10000 and change name to Full Name.

var result = db.UpdateById<Person>(person);

Get all records from Person table

var people = db.GetAll<Person>();

Custom Query with conditions

var people = db.Query<dynamic>("SELECT Id, Name, Income FROM Person WHERE
                                Income >= @MinIncome AND Income <= @MaxIncome",
                                new { MinIncome = 6000, MaxIncome = 12000 });

Delete a person by Id = 1 from the Person table

var result = db.DeleteById<Person>(1);
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. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen 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.

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
1.0.3.4 1,343 10/1/2022
1.0.3.3 464 9/17/2022
1.0.3.2 419 8/19/2022
1.0.3.1 409 8/19/2022
1.0.3 363 8/19/2022
1.0.2.1 273 1/2/2022
1.0.2 258 11/29/2021
1.0.1.9 236 11/27/2021
1.0.1.7 289 11/16/2021
1.0.1.6 296 11/8/2021
1.0.1.4 323 11/6/2021
1.0.1.3 275 11/4/2021
1.0.1.2 294 10/25/2021
1.0.1.1 295 10/23/2021
1.0.1 311 10/23/2021
1.0.0 295 10/23/2021