dotnet-cqrs/OpenHarbor.CQRS.DynamicQuery/Discover/DynamicQueryMeta.cs

33 lines
896 B
C#
Raw Normal View History

using System;
using Pluralize.NET;
using OpenHarbor.CQRS.Abstractions.Discovery;
namespace OpenHarbor.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
{
if (OverridableName != null)
return OverridableName;
var pluralizer = new Pluralizer();
return pluralizer.Pluralize(DestinationType.Name);
}
}
public Type ParamsType { get; internal set; }
public string OverridableName { get; internal set; }
}