SqlSharp 1.0.3

.NET Framework 4.7.1
Install-Package SqlSharp -Version 1.0.3
dotnet add package SqlSharp --version 1.0.3
<PackageReference Include="SqlSharp" Version="1.0.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SqlSharp --version 1.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: SqlSharp, 1.0.3"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install SqlSharp as a Cake Addin
#addin nuget:?package=SqlSharp&version=1.0.3

// Install SqlSharp as a Cake Tool
#tool nuget:?package=SqlSharp&version=1.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

SqlSharp

Generate SqlQuery for your type/object dynamically.

  ============  Query builder example:   ===============

  using SqlSharp;
  using SqlSharp.Query;

  SharpQuery select = SharpQuery
        .Select()
        .Field("Id").As("AccountId") // with alias
        .Field("AccountNumber") //name only
        .Where("account.created", Compare.GreaterThanEqual, "'2018-01-01'") //where clause
        .TopN(100)
        .From("account"); //table
  

  // sql output
  var sqlQuery = QueryHelper.GetSqlOutput(select);


  ===========   Generate Select dynamically =============
  
  //Query With Alias:

  // Add a class, Define column name with optional attribute, property name is used as Alias
  
  public class Account
  {
  
         [SqlSharp("Account.Id")] // column name
         public string AccountId { get; set; } // alias

         public string AccountNumber { get; set; }

  }

  // generate query:

  Account a = new Account();
  
  var fields = QueryHelper.GetSelects(a);

    SharpQuery select = SharpQuery
            .Select()
            .Fields(fields.ToArray())
            .Where("account.created", Compare.GreaterThanEqual, "'2018-01-01'")
            .TopN(100)
            .From("account");


    var sqlOutput = QueryHelper.GetSqlOutput(select);
Product Versions
.NET Framework net471 net472 net48
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

This package has 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
1.0.3 824 5/14/2018
1.0.2 742 5/14/2018
1.0.1 639 5/14/2018
1.0.0 697 5/10/2018