dotnet-dynamic-query/PoweredSoft.DynamicQuery/ServiceCollectionExtensions.cs
2018-12-06 21:24:03 -06:00

26 lines
1003 B
C#

using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using PoweredSoft.DynamicQuery.Core;
using System;
using System.Collections.Generic;
using System.Text;
namespace PoweredSoft.DynamicQuery
{
public static class ServiceCollectionExtensions
{
public static IServiceCollection AddPoweredSoftDynamicQuery(this IServiceCollection services)
{
services.TryAddTransient<ISort, Sort>();
services.TryAddTransient<IAggregate, Aggregate>();
services.TryAddTransient<ISimpleFilter, SimpleFilter>();
services.TryAddTransient<ICompositeFilter, CompositeFilter>();
services.TryAddTransient<IGroup, Group>();
services.TryAddTransient<IQueryCriteria, QueryCriteria>();
services.TryAddTransient<IQueryHandler, QueryHandler>();
services.TryAddTransient<IQueryHandlerAsync, QueryHandlerAsync>();
return services;
}
}
}