dotnet-cqrs/PoweredSoft.CQRS.DynamicQuery/Discover/DynamicQueryMeta.cs
2023-10-02 11:25:45 -04:00

33 lines
983 B
C#

using System;
using Pluralize.NET;
using PoweredSoft.CQRS.Abstractions.Discovery;
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
{
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; }
}
}