diff --git a/Finch/Context/FinchContext.cs b/Finch/Context/FinchContext.cs
index 57ae398e..0aaf6bea 100644
--- a/Finch/Context/FinchContext.cs
+++ b/Finch/Context/FinchContext.cs
@@ -1,42 +1,23 @@
using Microsoft.AspNetCore.Http;
-using Microsoft.Extensions.Logging;
namespace Finch.Context;
-public class FinchContext : IFinchContext
+public class FinchContext(
+ IFinchOptions options,
+ ICultureResolver cultureResolver,
+ IServiceProvider services)
+ : IFinchContext
{
///
- public IFinchOptions Options { get; protected set; }
+ public IFinchOptions Options { get; } = options;
+
///
- public IServiceProvider Services { get; }
-
- protected ICultureResolver CultureResolver { get; }
-
- protected ILogger Logger { get; private set; }
-
- protected IHandlerHolder Handler { get; private set; }
-
- protected IHttpContextAccessor HttpContextAccessor { get; private set; }
-
- protected IPrimitiveTypeCollection ValueCollection { get; }
+ public IServiceProvider Services { get; } = services;
bool _resolved = false;
- public FinchContext(IFinchOptions options, IHttpContextAccessor httpContextAccessor, ICultureResolver cultureResolver,
- ILogger logger, IHandlerHolder handler, IServiceProvider services)
- {
- Options = options;
- CultureResolver = cultureResolver;
- Logger = logger;
- Handler = handler;
- ValueCollection = new PrimitiveTypeCollection();
- HttpContextAccessor = httpContextAccessor;
- Services = services;
- }
-
-
///
public virtual async Task Resolve(HttpContext context)
{
@@ -45,23 +26,11 @@ public class FinchContext : IFinchContext
return;
}
- _resolved = true;
-
// set current culture
- await CultureResolver.Resolve(this);
+ await cultureResolver.Resolve(this);
+
+ _resolved = true;
}
-
-
- ///
- public T Get() => ValueCollection.Get();
-
-
- ///
- public void Set(T value) => ValueCollection.Set(value);
-
-
- ///
- public void Remove() => ValueCollection.Remove();
}
@@ -83,19 +52,4 @@ public interface IFinchContext
/// the currently active backoffice user, as users are not signed in with the default scheme and do therefore not populate HttpContext.User
///
Task Resolve(HttpContext context);
-
- ///
- /// Get a custom property from this scoped context
- ///
- T Get();
-
- ///
- /// Add a custom property to this scoped context
- ///
- void Set(T value);
-
- ///
- /// Remove a custom property from this scoped context
- ///
- void Remove();
}
\ No newline at end of file