ZeidLab.EzQuery
1.0.1
dotnet add package ZeidLab.EzQuery --version 1.0.1
NuGet\Install-Package ZeidLab.EzQuery -Version 1.0.1
<PackageReference Include="ZeidLab.EzQuery" Version="1.0.1" />
paket add ZeidLab.EzQuery --version 1.0.1
#r "nuget: ZeidLab.EzQuery, 1.0.1"
// Install ZeidLab.EzQuery as a Cake Addin
#addin nuget:?package=ZeidLab.EzQuery&version=1.0.1
// Install ZeidLab.EzQuery as a Cake Tool
#tool nuget:?package=ZeidLab.EzQuery&version=1.0.1
What is EzQuery?
EzQuery is a super easy to use, yet powerful library, to build SQL queries, to execute them , and to return populated sets of results of given table models. It does not contain a lot of features but it does the job.
Target Frameworks
EzQuery is a multi target package and targets following versions:
.Net 5.0 , .Net Core 3.1 and .Net Standard 2.1
A Simple How to Use
For a complete guide please go to the github repository.
Create your table models :
[Table("Users")]
public class User :EzQueryTable<User>
{
[Key]
public int Id { get; set; }
[Column("Name"),Required]
public string FirstName { get; set; }
public string LastName { get; set; }
public DateTime? BirthDay { get; set; }
public decimal Credit { get; set; }
[NotMapped]
public bool Status { get; set; }
}
[Table("Profiles")]
public class Profile : EzQueryTable<Profile>
{
public int Id { get; set; }
public int UserId { get; set; }
public string AvatarName { get; set; }
[NotMapped]
public bool Status { get; set; }
}
Query your database :
var queryBuilder = new EzQueryBuilder();
await using (var conn = new SqlConnection(Settings.ConnectionString))
{
await queryBuilder.From<User>()
.From<Profile>()
.Join<User,Profile>(nameof(User.Id),nameof(Profile.UserId))
.Where<User,Profile>( (u,p)=> u.FirstName.StartsWith("Test") && p.AvatarName.Contains("ed") && u.Id > 254)
.OrderBy<User>(nameof(User.LastName))
.OrderBy<Profile>(nameof(Profile.AvatarName),OrderByTypes.Asc)
.Paginate(currentPage:1,itemsPerPage:20)
.QuerySelectAsync(conn);
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. 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 is compatible. |
.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. |
-
.NETCoreApp 3.1
- Microsoft.Data.SqlClient (>= 2.1.1)
- System.ComponentModel.Annotations (>= 5.0.0)
- System.Linq.Expressions (>= 4.3.0)
-
.NETStandard 2.1
- Microsoft.Data.SqlClient (>= 2.1.1)
- System.ComponentModel.Annotations (>= 5.0.0)
- System.Linq.Expressions (>= 4.3.0)
-
net5.0
- Microsoft.Data.SqlClient (>= 2.1.1)
- System.ComponentModel.Annotations (>= 5.0.0)
- System.Linq.Expressions (>= 4.3.0)
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.1 | 950 | 1/11/2021 |
Multitargeting Package and fixing some miner problems