make auto-props get only

This commit is contained in:
2026-04-07 15:24:48 +02:00
parent e18c5ddc2f
commit 818b645c23
23 changed files with 46 additions and 49 deletions
+1 -1
View File
@@ -15,7 +15,7 @@ public class FinchStore : IFinchStore
/// <inheritdoc />
public IDocumentStore Raven { get; private set; }
public IDocumentStore Raven { get; }
/// <inheritdoc />
@@ -6,27 +6,27 @@ public class InterceptorInstruction<T> where T : FinchIdEntity, new()
{
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; }
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;
+4 -4
View File
@@ -15,13 +15,13 @@ public partial class RavenOperations : IRavenOperations
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; }
@@ -8,13 +8,13 @@ namespace Finch.Raven;
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 char IdentityPartsSeparator { get; set; } = '.';
protected IFinchOptions Options { get; private set; }
protected IFinchOptions Options { get; }
protected static ConcurrentDictionary<Type, string> CachedTypeCollectionNameMap = new();
+1 -1
View File
@@ -10,7 +10,7 @@ public class FinchTokenProvider : IFinchTokenProvider
readonly RandomNumberGenerator randonNumberGenerator;
protected IFinchStore Store { get; private set; }
protected IFinchStore Store { get; }
public FinchTokenProvider(IFinchStore store)
+5 -5
View File
@@ -19,15 +19,15 @@ public partial class DbOperations : IDbOperations
{
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)
+1 -1
View File
@@ -4,7 +4,7 @@ namespace Finch.Assemblies;
public class AssemblyDiscoveryContext
{
public Assembly EntryAssembly { get; private set; }
public Assembly EntryAssembly { get; }
public string EntryAssemblyName { get; private set; }
+1 -1
View File
@@ -21,7 +21,7 @@ public class FinchOptions : IFinchOptions
internal IServiceProvider ServiceProvider { get; set; }
protected ConcurrentDictionary<Type, object> OptionsCache { get; private set; } = new();
protected ConcurrentDictionary<Type, object> OptionsCache { get; } = new();
/// <inheritdoc />
+2 -2
View File
@@ -4,9 +4,9 @@ namespace Finch.Configuration;
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)
+3 -3
View File
@@ -8,9 +8,9 @@ public class FinchContext : IFinchContext
/// <inheritdoc />
public IFinchOptions Options { get; protected set; }
/// <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; }
@@ -18,7 +18,7 @@ public class FinchContext : IFinchContext
protected IHttpContextAccessor HttpContextAccessor { get; private set; }
protected IPrimitiveTypeCollection ValueCollection { get; private set; }
protected IPrimitiveTypeCollection ValueCollection { get; }
bool _resolved = false;
+1 -1
View File
@@ -25,7 +25,7 @@ public class Paths : IPaths
const char REPLACEMENT_CHAR = '-';
FileExtensionContentTypeProvider FileExtensionContentTypeProvider { get; set; }
FileExtensionContentTypeProvider FileExtensionContentTypeProvider { get; }
static readonly Dictionary<char, string> Replacements = new()
{
+1 -1
View File
@@ -20,7 +20,7 @@ public class FinchBuilder
public virtual IMvcBuilder Mvc { get; }
internal static FinchModuleCollection Modules { get; private set; } = new();
internal static FinchModuleCollection Modules { get; } = new();
readonly IConfiguration _configuration;
readonly IFinchStartupOptions _startupOptions;
+2 -2
View File
@@ -10,9 +10,9 @@ public class CultureResolver : ICultureResolver
/// <inheritdoc />
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)
+2 -2
View File
@@ -6,9 +6,9 @@ namespace Finch.Localization;
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; }
+1 -1
View File
@@ -9,7 +9,7 @@ namespace Finch.Mails;
/// </summary>
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; }
+1 -1
View File
@@ -8,7 +8,7 @@ namespace Finch.Mails;
public class PostmarkDispatcher : IMailDispatcher
{
protected Queue<Mail> Queue { get; private set; } = new();
protected Queue<Mail> Queue { get; } = new();
protected PostmarkClient Postmark { get; set; }
+1 -1
View File
@@ -8,7 +8,7 @@ public class MetadataService : IMetadataService
{
protected ILogger<MetadataService> Logger { get; private set; }
protected ILocalizer Localizer { get; private set; }
protected ILocalizer Localizer { get; }
public MetadataService(ILogger<MetadataService> logger, ILocalizer localizer)
+1 -1
View File
@@ -4,7 +4,7 @@ namespace Finch.Models;
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()
{
@@ -5,7 +5,7 @@ namespace Finch.Models;
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);
+1 -4
View File
@@ -1,7 +1,4 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.AspNetCore.Routing;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
namespace Finch.Mvc;
+2 -2
View File
@@ -5,9 +5,9 @@ namespace Finch.Routing;
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://" };
+1 -1
View File
@@ -10,7 +10,7 @@ public class ObjectCopycat
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)
+1 -1
View File
@@ -6,7 +6,7 @@ namespace Finch.Validation;
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();