make auto-props get only
This commit is contained in:
@@ -15,7 +15,7 @@ public class FinchStore : IFinchStore
|
|||||||
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public IDocumentStore Raven { get; private set; }
|
public IDocumentStore Raven { get; }
|
||||||
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
|||||||
@@ -6,27 +6,27 @@ public class InterceptorInstruction<T> where T : FinchIdEntity, new()
|
|||||||
{
|
{
|
||||||
public Guid Guid { get; private set; }
|
public Guid Guid { get; private set; }
|
||||||
|
|
||||||
public InterceptorRunType Runtype { get; private set; }
|
public InterceptorRunType Runtype { get; }
|
||||||
|
|
||||||
public T Model { get; private set; }
|
public T Model { get; }
|
||||||
|
|
||||||
public T PreviousModel { get; private set; }
|
public T PreviousModel { get; }
|
||||||
|
|
||||||
public Type ModelType { get; private set; }
|
public Type ModelType { get; }
|
||||||
|
|
||||||
public Result<T> Result { get; private set; }
|
public Result<T> Result { get; private set; }
|
||||||
|
|
||||||
protected IFinchContext Context { get; private set; }
|
protected IFinchContext Context { get; }
|
||||||
|
|
||||||
protected IFinchStore Store { get; private set; }
|
protected IFinchStore Store { get; }
|
||||||
|
|
||||||
protected Lazy<IEnumerable<IInterceptor>> Interceptors { get; private set; }
|
protected Lazy<IEnumerable<IInterceptor>> Interceptors { get; }
|
||||||
|
|
||||||
protected Dictionary<IInterceptor, InterceptorParameters> InterceptorCache { get; private set; } = new();
|
protected Dictionary<IInterceptor, InterceptorParameters> InterceptorCache { get; } = new();
|
||||||
|
|
||||||
protected IInterceptors InterceptorHandler { get; private set; }
|
protected IInterceptors InterceptorHandler { get; }
|
||||||
|
|
||||||
protected ILogger<IInterceptor> Logger { get; private set; }
|
protected ILogger<IInterceptor> Logger { get; }
|
||||||
|
|
||||||
protected Func<IInterceptor, bool> InterceptorFilter { get; private set; } = x => true;
|
protected Func<IInterceptor, bool> InterceptorFilter { get; private set; } = x => true;
|
||||||
|
|
||||||
|
|||||||
@@ -15,13 +15,13 @@ public partial class RavenOperations : IRavenOperations
|
|||||||
|
|
||||||
protected IFinchContext Context { get; private set; }
|
protected IFinchContext Context { get; private set; }
|
||||||
|
|
||||||
protected IInterceptors Interceptors { get; private set; }
|
protected IInterceptors Interceptors { get; }
|
||||||
|
|
||||||
protected FlavorOptions Flavors { get; private set; }
|
protected FlavorOptions Flavors { get; }
|
||||||
|
|
||||||
protected IServiceProvider Services { get; private set; }
|
protected IServiceProvider Services { get; }
|
||||||
|
|
||||||
protected IFinchStore Store { get; private set; }
|
protected IFinchStore Store { get; }
|
||||||
|
|
||||||
protected StoreInterceptorBlocker InterceptorBlocker { get; private set; }
|
protected StoreInterceptorBlocker InterceptorBlocker { get; private set; }
|
||||||
|
|
||||||
|
|||||||
@@ -8,13 +8,13 @@ namespace Finch.Raven;
|
|||||||
|
|
||||||
public class RavenDocumentConventionsBuilder : IRavenDocumentConventionsBuilder
|
public class RavenDocumentConventionsBuilder : IRavenDocumentConventionsBuilder
|
||||||
{
|
{
|
||||||
protected HashSet<Type> PolymorphTypes { get; private set; } = new();
|
protected HashSet<Type> PolymorphTypes { get; } = new();
|
||||||
|
|
||||||
protected Type AcceptsFinchConventionsType { get; set; } = typeof(ISupportsDbConventions);
|
protected Type AcceptsFinchConventionsType { get; set; } = typeof(ISupportsDbConventions);
|
||||||
|
|
||||||
protected char IdentityPartsSeparator { get; set; } = '.';
|
protected char IdentityPartsSeparator { get; set; } = '.';
|
||||||
|
|
||||||
protected IFinchOptions Options { get; private set; }
|
protected IFinchOptions Options { get; }
|
||||||
|
|
||||||
protected static ConcurrentDictionary<Type, string> CachedTypeCollectionNameMap = new();
|
protected static ConcurrentDictionary<Type, string> CachedTypeCollectionNameMap = new();
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ public class FinchTokenProvider : IFinchTokenProvider
|
|||||||
|
|
||||||
readonly RandomNumberGenerator randonNumberGenerator;
|
readonly RandomNumberGenerator randonNumberGenerator;
|
||||||
|
|
||||||
protected IFinchStore Store { get; private set; }
|
protected IFinchStore Store { get; }
|
||||||
|
|
||||||
|
|
||||||
public FinchTokenProvider(IFinchStore store)
|
public FinchTokenProvider(IFinchStore store)
|
||||||
|
|||||||
@@ -19,15 +19,15 @@ public partial class DbOperations : IDbOperations
|
|||||||
{
|
{
|
||||||
protected IFinchContext Context { get; private set; }
|
protected IFinchContext Context { get; private set; }
|
||||||
|
|
||||||
protected FlavorOptions Flavors { get; private set; }
|
protected FlavorOptions Flavors { get; }
|
||||||
|
|
||||||
protected IServiceProvider Services { get; private set; }
|
protected IServiceProvider Services { get; }
|
||||||
|
|
||||||
protected IDbConnection Db { get; private set; }
|
protected IDbConnection Db { get; }
|
||||||
|
|
||||||
protected ILogger<IDbOperations> Logger { get; private set; }
|
protected ILogger<IDbOperations> Logger { get; }
|
||||||
|
|
||||||
protected IEntityModifiedHandler EntityModifiedHandler { get; private set; }
|
protected IEntityModifiedHandler EntityModifiedHandler { get; }
|
||||||
|
|
||||||
|
|
||||||
public DbOperations(StoreContext context, IDbConnection db, ILogger<IDbOperations> logger, IHandlerHolder handler)
|
public DbOperations(StoreContext context, IDbConnection db, ILogger<IDbOperations> logger, IHandlerHolder handler)
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ namespace Finch.Assemblies;
|
|||||||
|
|
||||||
public class AssemblyDiscoveryContext
|
public class AssemblyDiscoveryContext
|
||||||
{
|
{
|
||||||
public Assembly EntryAssembly { get; private set; }
|
public Assembly EntryAssembly { get; }
|
||||||
|
|
||||||
public string EntryAssemblyName { get; private set; }
|
public string EntryAssemblyName { get; private set; }
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ public class FinchOptions : IFinchOptions
|
|||||||
|
|
||||||
internal IServiceProvider ServiceProvider { get; set; }
|
internal IServiceProvider ServiceProvider { get; set; }
|
||||||
|
|
||||||
protected ConcurrentDictionary<Type, object> OptionsCache { get; private set; } = new();
|
protected ConcurrentDictionary<Type, object> OptionsCache { get; } = new();
|
||||||
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
|||||||
@@ -4,9 +4,9 @@ namespace Finch.Configuration;
|
|||||||
|
|
||||||
public class FinchStartupOptions : IFinchStartupOptions
|
public class FinchStartupOptions : IFinchStartupOptions
|
||||||
{
|
{
|
||||||
public IList<IAssemblyDiscoveryRule> AssemblyDiscoveryRules { get; private set; } = new List<IAssemblyDiscoveryRule>();
|
public IList<IAssemblyDiscoveryRule> AssemblyDiscoveryRules { get; } = new List<IAssemblyDiscoveryRule>();
|
||||||
|
|
||||||
public IMvcBuilder Mvc { get; private set; }
|
public IMvcBuilder Mvc { get; }
|
||||||
|
|
||||||
|
|
||||||
public FinchStartupOptions(IMvcBuilder mvc)
|
public FinchStartupOptions(IMvcBuilder mvc)
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ public class FinchContext : IFinchContext
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public IFinchOptions Options { get; protected set; }
|
public IFinchOptions Options { get; protected set; }
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public IServiceProvider Services { get; private set; }
|
public IServiceProvider Services { get; }
|
||||||
|
|
||||||
protected ICultureResolver CultureResolver { get; private set; }
|
protected ICultureResolver CultureResolver { get; }
|
||||||
|
|
||||||
protected ILogger<FinchContext> Logger { get; private set; }
|
protected ILogger<FinchContext> Logger { get; private set; }
|
||||||
|
|
||||||
@@ -18,7 +18,7 @@ public class FinchContext : IFinchContext
|
|||||||
|
|
||||||
protected IHttpContextAccessor HttpContextAccessor { get; private set; }
|
protected IHttpContextAccessor HttpContextAccessor { get; private set; }
|
||||||
|
|
||||||
protected IPrimitiveTypeCollection ValueCollection { get; private set; }
|
protected IPrimitiveTypeCollection ValueCollection { get; }
|
||||||
|
|
||||||
|
|
||||||
bool _resolved = false;
|
bool _resolved = false;
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ public class Paths : IPaths
|
|||||||
|
|
||||||
const char REPLACEMENT_CHAR = '-';
|
const char REPLACEMENT_CHAR = '-';
|
||||||
|
|
||||||
FileExtensionContentTypeProvider FileExtensionContentTypeProvider { get; set; }
|
FileExtensionContentTypeProvider FileExtensionContentTypeProvider { get; }
|
||||||
|
|
||||||
static readonly Dictionary<char, string> Replacements = new()
|
static readonly Dictionary<char, string> Replacements = new()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ public class FinchBuilder
|
|||||||
|
|
||||||
public virtual IMvcBuilder Mvc { get; }
|
public virtual IMvcBuilder Mvc { get; }
|
||||||
|
|
||||||
internal static FinchModuleCollection Modules { get; private set; } = new();
|
internal static FinchModuleCollection Modules { get; } = new();
|
||||||
|
|
||||||
readonly IConfiguration _configuration;
|
readonly IConfiguration _configuration;
|
||||||
readonly IFinchStartupOptions _startupOptions;
|
readonly IFinchStartupOptions _startupOptions;
|
||||||
|
|||||||
@@ -10,9 +10,9 @@ public class CultureResolver : ICultureResolver
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public CultureInfo Current { get; protected set; }
|
public CultureInfo Current { get; protected set; }
|
||||||
|
|
||||||
protected ILogger<CultureResolver> Logger { get; private set; }
|
protected ILogger<CultureResolver> Logger { get; }
|
||||||
|
|
||||||
protected IMessageAggregator MessageAggregator { get; private set; }
|
protected IMessageAggregator MessageAggregator { get; }
|
||||||
|
|
||||||
|
|
||||||
public CultureResolver(ILogger<CultureResolver> logger, IMessageAggregator messageAggregator)
|
public CultureResolver(ILogger<CultureResolver> logger, IMessageAggregator messageAggregator)
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ namespace Finch.Localization;
|
|||||||
|
|
||||||
public abstract class Localizer : ILocalizer
|
public abstract class Localizer : ILocalizer
|
||||||
{
|
{
|
||||||
protected ConcurrentDictionary<string, string> Cache { get; private set; } = new();
|
protected ConcurrentDictionary<string, string> Cache { get; } = new();
|
||||||
|
|
||||||
protected ICultureResolver CultureResolver { get; private set; }
|
protected ICultureResolver CultureResolver { get; }
|
||||||
|
|
||||||
protected string LanguageCode { get; set; }
|
protected string LanguageCode { get; set; }
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ namespace Finch.Mails;
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class LoggerMailDispatcher : IMailDispatcher
|
public class LoggerMailDispatcher : IMailDispatcher
|
||||||
{
|
{
|
||||||
protected Queue<Mail> Queue { get; private set; } = new Queue<Mail>();
|
protected Queue<Mail> Queue { get; } = new Queue<Mail>();
|
||||||
|
|
||||||
protected ILogger<LoggerMailDispatcher> Logger { get; set; }
|
protected ILogger<LoggerMailDispatcher> Logger { get; set; }
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ namespace Finch.Mails;
|
|||||||
|
|
||||||
public class PostmarkDispatcher : IMailDispatcher
|
public class PostmarkDispatcher : IMailDispatcher
|
||||||
{
|
{
|
||||||
protected Queue<Mail> Queue { get; private set; } = new();
|
protected Queue<Mail> Queue { get; } = new();
|
||||||
|
|
||||||
protected PostmarkClient Postmark { get; set; }
|
protected PostmarkClient Postmark { get; set; }
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ public class MetadataService : IMetadataService
|
|||||||
{
|
{
|
||||||
protected ILogger<MetadataService> Logger { get; private set; }
|
protected ILogger<MetadataService> Logger { get; private set; }
|
||||||
|
|
||||||
protected ILocalizer Localizer { get; private set; }
|
protected ILocalizer Localizer { get; }
|
||||||
|
|
||||||
|
|
||||||
public MetadataService(ILogger<MetadataService> logger, ILocalizer localizer)
|
public MetadataService(ILogger<MetadataService> logger, ILocalizer localizer)
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ namespace Finch.Models;
|
|||||||
|
|
||||||
public class FlavorOptions
|
public class FlavorOptions
|
||||||
{
|
{
|
||||||
public ConcurrentDictionary<Type, FlavorProvider> Providers { get; private set; } = new();
|
public ConcurrentDictionary<Type, FlavorProvider> Providers { get; } = new();
|
||||||
|
|
||||||
public void Configure<TEntity>(Action<FlavorProviderOptions<TEntity>> configure) where TEntity : class, ISupportsFlavors, new()
|
public void Configure<TEntity>(Action<FlavorProviderOptions<TEntity>> configure) where TEntity : class, ISupportsFlavors, new()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ namespace Finch.Models;
|
|||||||
|
|
||||||
internal class JsonFlavorVariantConverter<T> : JsonDiscriminatorConverter<T> where T : class, ISupportsFlavors, new()
|
internal class JsonFlavorVariantConverter<T> : JsonDiscriminatorConverter<T> where T : class, ISupportsFlavors, new()
|
||||||
{
|
{
|
||||||
protected FlavorProvider Provider { get; private set; }
|
protected FlavorProvider Provider { get; }
|
||||||
|
|
||||||
Type _factoryType = typeof(JsonFlavorVariantConverterFactory);
|
Type _factoryType = typeof(JsonFlavorVariantConverterFactory);
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
using Microsoft.AspNetCore.Builder;
|
using Microsoft.Extensions.Configuration;
|
||||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
|
||||||
using Microsoft.AspNetCore.Routing;
|
|
||||||
using Microsoft.Extensions.Configuration;
|
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
|
||||||
namespace Finch.Mvc;
|
namespace Finch.Mvc;
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ namespace Finch.Routing;
|
|||||||
|
|
||||||
public class RequestUrlResolver : IRequestUrlResolver
|
public class RequestUrlResolver : IRequestUrlResolver
|
||||||
{
|
{
|
||||||
protected IHttpContextAccessor HttpContextAccessor { get; private set; }
|
protected IHttpContextAccessor HttpContextAccessor { get; }
|
||||||
|
|
||||||
protected ILogger<RequestUrlResolver> Logger { get; private set; }
|
protected ILogger<RequestUrlResolver> Logger { get; }
|
||||||
|
|
||||||
static string[] Protocols = new[] { "http://", "https://", "ftp://", "ftps://", "sftp://", "udp://" };
|
static string[] Protocols = new[] { "http://", "https://", "ftp://", "ftps://", "sftp://", "udp://" };
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ public class ObjectCopycat
|
|||||||
|
|
||||||
static readonly Type STRING_TYPE = typeof(string);
|
static readonly Type STRING_TYPE = typeof(string);
|
||||||
|
|
||||||
static ConcurrentDictionary<string, IEnumerable<PropertyInfo>> PublicPropertiesPerType { get; set; } = new();
|
static ConcurrentDictionary<string, IEnumerable<PropertyInfo>> PublicPropertiesPerType { get; } = new();
|
||||||
|
|
||||||
|
|
||||||
public static T Clone<T>(T obj)
|
public static T Clone<T>(T obj)
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ namespace Finch.Validation;
|
|||||||
|
|
||||||
public class FinchMergedValidator<T> : IFinchMergedValidator<T>
|
public class FinchMergedValidator<T> : IFinchMergedValidator<T>
|
||||||
{
|
{
|
||||||
protected IEnumerable<IValidator<T>> Validators { get; private set; }
|
protected IEnumerable<IValidator<T>> Validators { get; }
|
||||||
|
|
||||||
ConcurrentDictionary<Type, IEnumerable<IValidator<T>>> TypeCache = new();
|
ConcurrentDictionary<Type, IEnumerable<IValidator<T>>> TypeCache = new();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user