Yozian.Extension 1.0.0

There is a newer version of this package available.
See the version list below for details.
Install-Package Yozian.Extension -Version 1.0.0
dotnet add package Yozian.Extension --version 1.0.0
<PackageReference Include="Yozian.Extension" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Yozian.Extension --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Yozian.Extension, 1.0.0"
#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 Yozian.Extension as a Cake Addin
#addin nuget:?package=Yozian.Extension&version=1.0.0

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

Useful Extension methods

Currently wiki is under working, you could take a look into test project to get examples.

Type Decorated

  • Exception
  • Expression
  • ICollection
  • IDicationary
  • IEnumerable
  • IQueryable
  • Object
  • String

Take IQueryable Extension method as example

conditional query where closure

The example shows the extension method WhereWhen eliminate if statement block.

The constrain applied only when the condition matched, so that you could achieve dynamic query easily!

var books = await this.dbContext.Book
                .Where(x => x.Name.Equals(request.Name))
                    x => x.Category.Equals(request.Category)
                    x => x.PublishDate.Equals(request.PublishDate)

for old school way, would have lots of if statement block

var query = this.dbContext.Book
                .Where(x => x.Name.Equals(request.Name));

    query = query.Where(x => x.Category.Equals(request.Category))

    query = query.Where(x => x.PublishDate.Equals(request.PublishDate))

var books = await query.ToListAsync();

feel free for pull request

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Yozian.Extension:

Package Downloads

Easy for DI register, Auto register services, Decorate service with attribute


partial updated and scheam description scripts generation


fluent strong type validation

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.2.7 209 3/30/2021
2.2.6 83 3/22/2021
2.2.4 119 3/11/2021
2.2.2 74 3/11/2021
2.2.2-preview 70 3/11/2021
2.2.1 276 3/8/2020
2.2.0 216 2/6/2020
2.1.3 208 12/22/2019
2.1.1 535 1/21/2019
2.1.0 530 1/16/2019
2.0.1 633 1/14/2019
2.0.0 1,002 1/13/2019
1.0.1 519 1/10/2019
1.0.0 846 1/9/2019