2021-02-02 19:01:29 -05:00
|
|
|
|
using PoweredSoft.CQRS.Abstractions.Discovery;
|
|
|
|
|
using PoweredSoft.CQRS.Discovery;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
namespace PoweredSoft.CQRS.DynamicQuery.Discover
|
|
|
|
|
{
|
|
|
|
|
public class DynamicQueryMeta : QueryMeta
|
|
|
|
|
{
|
|
|
|
|
public DynamicQueryMeta(Type queryType, Type serviceType, Type queryResultType) : base(queryType, serviceType, queryResultType)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Type SourceType => QueryType.GetGenericArguments()[0];
|
|
|
|
|
public Type DestinationType => QueryType.GetGenericArguments()[1];
|
|
|
|
|
public override string Category => "DynamicQuery";
|
|
|
|
|
public override string Name
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
2021-02-02 19:32:39 -05:00
|
|
|
|
if (OverridableName != null)
|
|
|
|
|
return OverridableName;
|
2021-02-02 19:01:29 -05:00
|
|
|
|
|
|
|
|
|
var pluralizer = new Pluralize.NET.Pluralizer();
|
|
|
|
|
return pluralizer.Pluralize(DestinationType.Name);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Type ParamsType { get; internal set; }
|
2021-02-02 19:32:39 -05:00
|
|
|
|
public string OverridableName { get; internal set; }
|
2021-02-02 19:01:29 -05:00
|
|
|
|
}
|
|
|
|
|
}
|