ZeidLab.EzQuery 1.0.1

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.

Install-Package ZeidLab.EzQuery -Version 1.0.1
dotnet add package ZeidLab.EzQuery --version 1.0.1
<PackageReference Include="ZeidLab.EzQuery" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ZeidLab.EzQuery --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: ZeidLab.EzQuery, 1.0.1"
#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 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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

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);
                
    }

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);
                
    }

Release Notes

Multitargeting Package and fixing some miner problems

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.1 75 1/11/2021