QueryFilterTemplate 1.0.0

dotnet new install QueryFilterTemplate::1.0.0
                    
This package contains a .NET Template Package you can call from the shell/command line.

QueryFilter Template

Prerequisites

This template assumes the installation of the QueryFilters NuGet package.

Usage

dotnet new filter --entityType <EntityName> --name <FileName>

Parameters

  • --entityType: The name of the class to which the filter will be applied.
  • --name: The name of the filter file.

Output

using QueryFilters.Filters;

namespace <Namespace>.Filters;

public class <entityType>Filter : QueryFilter
{
    public string? Property { get; set; }
}

public static class <entityType>FilterExtensions
{
    //Filter method must have the same name as the property it filters.

    public static IQueryable<<entityType>> Property(this IQueryable<<entityType>> query, string value)
    {
        //Implement the filter logic here
        throw new NotImplementedException();
    }

}

The <entityType> will be replaced by the --entityType parameter, or "Object" by default. The <Namespace> will be replaced by the namespace of the project where the filter is created.

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.0 440 9/30/2024