Implements Public Access in netcore (#10137)
* Getting new netcore PublicAccessChecker in place
* Adds full test coverage for PublicAccessChecker
* remove PublicAccessComposer
* adjust namespaces, ensure RoleManager works, separate public access controller, reduce content controller
* Implements the required methods on IMemberManager, removes old migrated code
* Updates routing to be able to re-route, Fixes middleware ordering ensuring endpoints are last, refactors pipeline options, adds public access middleware, ensures public access follows all hops
* adds note
* adds note
* Cleans up ext methods, ensures that members identity is added on both front-end and back ends. updates how UmbracoApplicationBuilder works in that it explicitly starts endpoints at the time of calling.
* Changes name to IUmbracoEndpointBuilder
* adds note
* Fixing tests, fixing error describers so there's 2x one for back office, one for members, fixes TryConvertTo, fixes login redirect
* fixing build
* Fixes keepalive, fixes PublicAccessMiddleware to not throw, updates startup code to be more clear and removes magic that registers middleware.
* adds note
* removes unused filter, fixes build
* fixes WebPath and tests
* Looks up entities in one query
* remove usings
* Fix test, remove stylesheet
* Set status code before we write to response to avoid error
* Ensures that users and members are validated when logging in. Shares more code between users and members.
* Fixes RepositoryCacheKeys to ensure the keys are normalized
* oops didn't mean to commit this
* Fix casing issues with caching, stop boxing value types for all cache operations, stop re-creating string keys in DefaultRepositoryCachePolicy
* bah, far out this keeps getting recommitted. sorry
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2021-04-20 15:11:45 +10:00
|
|
|
// Copyright (c) Umbraco.
|
2021-02-12 10:13:56 +01:00
|
|
|
// See LICENSE for more details.
|
|
|
|
|
|
|
|
|
|
using System;
|
2016-01-07 16:31:20 +01:00
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
2021-02-09 10:22:42 +01:00
|
|
|
using Umbraco.Cms.Core.Models.Entities;
|
2021-02-15 11:41:12 +01:00
|
|
|
using Umbraco.Cms.Core.Scoping;
|
2022-01-13 17:44:11 +00:00
|
|
|
using Umbraco.Cms.Infrastructure.Scoping;
|
2021-02-09 11:26:22 +01:00
|
|
|
using Umbraco.Extensions;
|
2016-01-07 16:31:20 +01:00
|
|
|
|
2021-02-12 10:13:56 +01:00
|
|
|
namespace Umbraco.Cms.Core.Cache
|
2016-01-07 16:31:20 +01:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
2016-06-01 10:35:44 +02:00
|
|
|
/// Represents the default cache policy.
|
2016-01-07 16:31:20 +01:00
|
|
|
/// </summary>
|
2016-06-01 10:35:44 +02:00
|
|
|
/// <typeparam name="TEntity">The type of the entity.</typeparam>
|
|
|
|
|
/// <typeparam name="TId">The type of the identifier.</typeparam>
|
2016-01-26 19:13:42 +01:00
|
|
|
/// <remarks>
|
2016-06-01 10:35:44 +02:00
|
|
|
/// <para>The default cache policy caches entities with a 5 minutes sliding expiration.</para>
|
|
|
|
|
/// <para>Each entity is cached individually.</para>
|
|
|
|
|
/// <para>If options.GetAllCacheAllowZeroCount then a 'zero-count' array is cached when GetAll finds nothing.</para>
|
|
|
|
|
/// <para>If options.GetAllCacheValidateCount then we check against the db when getting many entities.</para>
|
2016-01-26 19:13:42 +01:00
|
|
|
/// </remarks>
|
2019-11-07 19:39:20 +11:00
|
|
|
public class DefaultRepositoryCachePolicy<TEntity, TId> : RepositoryCachePolicyBase<TEntity, TId>
|
2018-01-10 12:48:51 +01:00
|
|
|
where TEntity : class, IEntity
|
2016-01-07 16:31:20 +01:00
|
|
|
{
|
Implements Public Access in netcore (#10137)
* Getting new netcore PublicAccessChecker in place
* Adds full test coverage for PublicAccessChecker
* remove PublicAccessComposer
* adjust namespaces, ensure RoleManager works, separate public access controller, reduce content controller
* Implements the required methods on IMemberManager, removes old migrated code
* Updates routing to be able to re-route, Fixes middleware ordering ensuring endpoints are last, refactors pipeline options, adds public access middleware, ensures public access follows all hops
* adds note
* adds note
* Cleans up ext methods, ensures that members identity is added on both front-end and back ends. updates how UmbracoApplicationBuilder works in that it explicitly starts endpoints at the time of calling.
* Changes name to IUmbracoEndpointBuilder
* adds note
* Fixing tests, fixing error describers so there's 2x one for back office, one for members, fixes TryConvertTo, fixes login redirect
* fixing build
* Fixes keepalive, fixes PublicAccessMiddleware to not throw, updates startup code to be more clear and removes magic that registers middleware.
* adds note
* removes unused filter, fixes build
* fixes WebPath and tests
* Looks up entities in one query
* remove usings
* Fix test, remove stylesheet
* Set status code before we write to response to avoid error
* Ensures that users and members are validated when logging in. Shares more code between users and members.
* Fixes RepositoryCacheKeys to ensure the keys are normalized
* oops didn't mean to commit this
* Fix casing issues with caching, stop boxing value types for all cache operations, stop re-creating string keys in DefaultRepositoryCachePolicy
* bah, far out this keeps getting recommitted. sorry
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2021-04-20 15:11:45 +10:00
|
|
|
private static readonly TEntity[] s_emptyEntities = new TEntity[0]; // const
|
2016-01-07 16:31:20 +01:00
|
|
|
private readonly RepositoryCachePolicyOptions _options;
|
2016-06-01 10:35:44 +02:00
|
|
|
|
2019-01-18 07:56:38 +01:00
|
|
|
public DefaultRepositoryCachePolicy(IAppPolicyCache cache, IScopeAccessor scopeAccessor, RepositoryCachePolicyOptions options)
|
2017-12-15 16:29:14 +01:00
|
|
|
: base(cache, scopeAccessor)
|
2016-06-01 10:35:44 +02:00
|
|
|
{
|
2017-05-12 14:49:44 +02:00
|
|
|
_options = options ?? throw new ArgumentNullException(nameof(options));
|
|
|
|
|
}
|
|
|
|
|
|
Implements Public Access in netcore (#10137)
* Getting new netcore PublicAccessChecker in place
* Adds full test coverage for PublicAccessChecker
* remove PublicAccessComposer
* adjust namespaces, ensure RoleManager works, separate public access controller, reduce content controller
* Implements the required methods on IMemberManager, removes old migrated code
* Updates routing to be able to re-route, Fixes middleware ordering ensuring endpoints are last, refactors pipeline options, adds public access middleware, ensures public access follows all hops
* adds note
* adds note
* Cleans up ext methods, ensures that members identity is added on both front-end and back ends. updates how UmbracoApplicationBuilder works in that it explicitly starts endpoints at the time of calling.
* Changes name to IUmbracoEndpointBuilder
* adds note
* Fixing tests, fixing error describers so there's 2x one for back office, one for members, fixes TryConvertTo, fixes login redirect
* fixing build
* Fixes keepalive, fixes PublicAccessMiddleware to not throw, updates startup code to be more clear and removes magic that registers middleware.
* adds note
* removes unused filter, fixes build
* fixes WebPath and tests
* Looks up entities in one query
* remove usings
* Fix test, remove stylesheet
* Set status code before we write to response to avoid error
* Ensures that users and members are validated when logging in. Shares more code between users and members.
* Fixes RepositoryCacheKeys to ensure the keys are normalized
* oops didn't mean to commit this
* Fix casing issues with caching, stop boxing value types for all cache operations, stop re-creating string keys in DefaultRepositoryCachePolicy
* bah, far out this keeps getting recommitted. sorry
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2021-04-20 15:11:45 +10:00
|
|
|
protected string GetEntityCacheKey(int id) => EntityTypeCacheKey + id;
|
2016-01-14 18:11:48 +01:00
|
|
|
|
2022-02-24 10:22:20 +01:00
|
|
|
protected string GetEntityCacheKey(TId? id)
|
2016-06-01 10:35:44 +02:00
|
|
|
{
|
Implements Public Access in netcore (#10137)
* Getting new netcore PublicAccessChecker in place
* Adds full test coverage for PublicAccessChecker
* remove PublicAccessComposer
* adjust namespaces, ensure RoleManager works, separate public access controller, reduce content controller
* Implements the required methods on IMemberManager, removes old migrated code
* Updates routing to be able to re-route, Fixes middleware ordering ensuring endpoints are last, refactors pipeline options, adds public access middleware, ensures public access follows all hops
* adds note
* adds note
* Cleans up ext methods, ensures that members identity is added on both front-end and back ends. updates how UmbracoApplicationBuilder works in that it explicitly starts endpoints at the time of calling.
* Changes name to IUmbracoEndpointBuilder
* adds note
* Fixing tests, fixing error describers so there's 2x one for back office, one for members, fixes TryConvertTo, fixes login redirect
* fixing build
* Fixes keepalive, fixes PublicAccessMiddleware to not throw, updates startup code to be more clear and removes magic that registers middleware.
* adds note
* removes unused filter, fixes build
* fixes WebPath and tests
* Looks up entities in one query
* remove usings
* Fix test, remove stylesheet
* Set status code before we write to response to avoid error
* Ensures that users and members are validated when logging in. Shares more code between users and members.
* Fixes RepositoryCacheKeys to ensure the keys are normalized
* oops didn't mean to commit this
* Fix casing issues with caching, stop boxing value types for all cache operations, stop re-creating string keys in DefaultRepositoryCachePolicy
* bah, far out this keeps getting recommitted. sorry
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2021-04-20 15:11:45 +10:00
|
|
|
if (EqualityComparer<TId>.Default.Equals(id, default))
|
|
|
|
|
{
|
|
|
|
|
return string.Empty;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (typeof(TId).IsValueType)
|
|
|
|
|
{
|
|
|
|
|
return EntityTypeCacheKey + id;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2022-02-18 14:32:51 +01:00
|
|
|
return EntityTypeCacheKey + id?.ToString()?.ToUpperInvariant();
|
Implements Public Access in netcore (#10137)
* Getting new netcore PublicAccessChecker in place
* Adds full test coverage for PublicAccessChecker
* remove PublicAccessComposer
* adjust namespaces, ensure RoleManager works, separate public access controller, reduce content controller
* Implements the required methods on IMemberManager, removes old migrated code
* Updates routing to be able to re-route, Fixes middleware ordering ensuring endpoints are last, refactors pipeline options, adds public access middleware, ensures public access follows all hops
* adds note
* adds note
* Cleans up ext methods, ensures that members identity is added on both front-end and back ends. updates how UmbracoApplicationBuilder works in that it explicitly starts endpoints at the time of calling.
* Changes name to IUmbracoEndpointBuilder
* adds note
* Fixing tests, fixing error describers so there's 2x one for back office, one for members, fixes TryConvertTo, fixes login redirect
* fixing build
* Fixes keepalive, fixes PublicAccessMiddleware to not throw, updates startup code to be more clear and removes magic that registers middleware.
* adds note
* removes unused filter, fixes build
* fixes WebPath and tests
* Looks up entities in one query
* remove usings
* Fix test, remove stylesheet
* Set status code before we write to response to avoid error
* Ensures that users and members are validated when logging in. Shares more code between users and members.
* Fixes RepositoryCacheKeys to ensure the keys are normalized
* oops didn't mean to commit this
* Fix casing issues with caching, stop boxing value types for all cache operations, stop re-creating string keys in DefaultRepositoryCachePolicy
* bah, far out this keeps getting recommitted. sorry
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2021-04-20 15:11:45 +10:00
|
|
|
}
|
2016-01-07 16:31:20 +01:00
|
|
|
}
|
|
|
|
|
|
Implements Public Access in netcore (#10137)
* Getting new netcore PublicAccessChecker in place
* Adds full test coverage for PublicAccessChecker
* remove PublicAccessComposer
* adjust namespaces, ensure RoleManager works, separate public access controller, reduce content controller
* Implements the required methods on IMemberManager, removes old migrated code
* Updates routing to be able to re-route, Fixes middleware ordering ensuring endpoints are last, refactors pipeline options, adds public access middleware, ensures public access follows all hops
* adds note
* adds note
* Cleans up ext methods, ensures that members identity is added on both front-end and back ends. updates how UmbracoApplicationBuilder works in that it explicitly starts endpoints at the time of calling.
* Changes name to IUmbracoEndpointBuilder
* adds note
* Fixing tests, fixing error describers so there's 2x one for back office, one for members, fixes TryConvertTo, fixes login redirect
* fixing build
* Fixes keepalive, fixes PublicAccessMiddleware to not throw, updates startup code to be more clear and removes magic that registers middleware.
* adds note
* removes unused filter, fixes build
* fixes WebPath and tests
* Looks up entities in one query
* remove usings
* Fix test, remove stylesheet
* Set status code before we write to response to avoid error
* Ensures that users and members are validated when logging in. Shares more code between users and members.
* Fixes RepositoryCacheKeys to ensure the keys are normalized
* oops didn't mean to commit this
* Fix casing issues with caching, stop boxing value types for all cache operations, stop re-creating string keys in DefaultRepositoryCachePolicy
* bah, far out this keeps getting recommitted. sorry
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2021-04-20 15:11:45 +10:00
|
|
|
protected string EntityTypeCacheKey { get; } = $"uRepo_{typeof(TEntity).Name}_";
|
|
|
|
|
|
2016-06-01 14:31:33 +02:00
|
|
|
protected virtual void InsertEntity(string cacheKey, TEntity entity)
|
Implements Public Access in netcore (#10137)
* Getting new netcore PublicAccessChecker in place
* Adds full test coverage for PublicAccessChecker
* remove PublicAccessComposer
* adjust namespaces, ensure RoleManager works, separate public access controller, reduce content controller
* Implements the required methods on IMemberManager, removes old migrated code
* Updates routing to be able to re-route, Fixes middleware ordering ensuring endpoints are last, refactors pipeline options, adds public access middleware, ensures public access follows all hops
* adds note
* adds note
* Cleans up ext methods, ensures that members identity is added on both front-end and back ends. updates how UmbracoApplicationBuilder works in that it explicitly starts endpoints at the time of calling.
* Changes name to IUmbracoEndpointBuilder
* adds note
* Fixing tests, fixing error describers so there's 2x one for back office, one for members, fixes TryConvertTo, fixes login redirect
* fixing build
* Fixes keepalive, fixes PublicAccessMiddleware to not throw, updates startup code to be more clear and removes magic that registers middleware.
* adds note
* removes unused filter, fixes build
* fixes WebPath and tests
* Looks up entities in one query
* remove usings
* Fix test, remove stylesheet
* Set status code before we write to response to avoid error
* Ensures that users and members are validated when logging in. Shares more code between users and members.
* Fixes RepositoryCacheKeys to ensure the keys are normalized
* oops didn't mean to commit this
* Fix casing issues with caching, stop boxing value types for all cache operations, stop re-creating string keys in DefaultRepositoryCachePolicy
* bah, far out this keeps getting recommitted. sorry
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2021-04-20 15:11:45 +10:00
|
|
|
=> Cache.Insert(cacheKey, () => entity, TimeSpan.FromMinutes(5), true);
|
2016-01-07 16:31:20 +01:00
|
|
|
|
2022-02-24 10:22:20 +01:00
|
|
|
protected virtual void InsertEntities(TId[]? ids, TEntity[]? entities)
|
2016-01-07 16:31:20 +01:00
|
|
|
{
|
2022-02-24 10:22:20 +01:00
|
|
|
if (ids?.Length == 0 && entities?.Length == 0 && _options.GetAllCacheAllowZeroCount)
|
2016-06-01 10:35:44 +02:00
|
|
|
{
|
2016-06-01 14:31:33 +02:00
|
|
|
// getting all of them, and finding nothing.
|
|
|
|
|
// if we can cache a zero count, cache an empty array,
|
|
|
|
|
// for as long as the cache is not cleared (no expiration)
|
Implements Public Access in netcore (#10137)
* Getting new netcore PublicAccessChecker in place
* Adds full test coverage for PublicAccessChecker
* remove PublicAccessComposer
* adjust namespaces, ensure RoleManager works, separate public access controller, reduce content controller
* Implements the required methods on IMemberManager, removes old migrated code
* Updates routing to be able to re-route, Fixes middleware ordering ensuring endpoints are last, refactors pipeline options, adds public access middleware, ensures public access follows all hops
* adds note
* adds note
* Cleans up ext methods, ensures that members identity is added on both front-end and back ends. updates how UmbracoApplicationBuilder works in that it explicitly starts endpoints at the time of calling.
* Changes name to IUmbracoEndpointBuilder
* adds note
* Fixing tests, fixing error describers so there's 2x one for back office, one for members, fixes TryConvertTo, fixes login redirect
* fixing build
* Fixes keepalive, fixes PublicAccessMiddleware to not throw, updates startup code to be more clear and removes magic that registers middleware.
* adds note
* removes unused filter, fixes build
* fixes WebPath and tests
* Looks up entities in one query
* remove usings
* Fix test, remove stylesheet
* Set status code before we write to response to avoid error
* Ensures that users and members are validated when logging in. Shares more code between users and members.
* Fixes RepositoryCacheKeys to ensure the keys are normalized
* oops didn't mean to commit this
* Fix casing issues with caching, stop boxing value types for all cache operations, stop re-creating string keys in DefaultRepositoryCachePolicy
* bah, far out this keeps getting recommitted. sorry
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2021-04-20 15:11:45 +10:00
|
|
|
Cache.Insert(EntityTypeCacheKey, () => s_emptyEntities);
|
2016-06-01 14:31:33 +02:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2022-02-24 10:22:20 +01:00
|
|
|
if (entities is not null)
|
2016-06-01 10:35:44 +02:00
|
|
|
{
|
2022-02-24 10:22:20 +01:00
|
|
|
// individually cache each item
|
|
|
|
|
foreach (var entity in entities)
|
|
|
|
|
{
|
|
|
|
|
var capture = entity;
|
|
|
|
|
Cache.Insert(GetEntityCacheKey(entity.Id), () => capture, TimeSpan.FromMinutes(5), true);
|
|
|
|
|
}
|
2016-06-01 10:35:44 +02:00
|
|
|
}
|
2016-06-01 14:31:33 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
|
public override void Create(TEntity entity, Action<TEntity> persistNew)
|
|
|
|
|
{
|
|
|
|
|
if (entity == null) throw new ArgumentNullException(nameof(entity));
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
persistNew(entity);
|
|
|
|
|
|
|
|
|
|
// just to be safe, we cannot cache an item without an identity
|
|
|
|
|
if (entity.HasIdentity)
|
2016-06-01 10:35:44 +02:00
|
|
|
{
|
2019-01-17 11:01:23 +01:00
|
|
|
Cache.Insert(GetEntityCacheKey(entity.Id), () => entity, TimeSpan.FromMinutes(5), true);
|
2016-06-01 10:35:44 +02:00
|
|
|
}
|
2016-06-01 14:31:33 +02:00
|
|
|
|
|
|
|
|
// if there's a GetAllCacheAllowZeroCount cache, ensure it is cleared
|
Implements Public Access in netcore (#10137)
* Getting new netcore PublicAccessChecker in place
* Adds full test coverage for PublicAccessChecker
* remove PublicAccessComposer
* adjust namespaces, ensure RoleManager works, separate public access controller, reduce content controller
* Implements the required methods on IMemberManager, removes old migrated code
* Updates routing to be able to re-route, Fixes middleware ordering ensuring endpoints are last, refactors pipeline options, adds public access middleware, ensures public access follows all hops
* adds note
* adds note
* Cleans up ext methods, ensures that members identity is added on both front-end and back ends. updates how UmbracoApplicationBuilder works in that it explicitly starts endpoints at the time of calling.
* Changes name to IUmbracoEndpointBuilder
* adds note
* Fixing tests, fixing error describers so there's 2x one for back office, one for members, fixes TryConvertTo, fixes login redirect
* fixing build
* Fixes keepalive, fixes PublicAccessMiddleware to not throw, updates startup code to be more clear and removes magic that registers middleware.
* adds note
* removes unused filter, fixes build
* fixes WebPath and tests
* Looks up entities in one query
* remove usings
* Fix test, remove stylesheet
* Set status code before we write to response to avoid error
* Ensures that users and members are validated when logging in. Shares more code between users and members.
* Fixes RepositoryCacheKeys to ensure the keys are normalized
* oops didn't mean to commit this
* Fix casing issues with caching, stop boxing value types for all cache operations, stop re-creating string keys in DefaultRepositoryCachePolicy
* bah, far out this keeps getting recommitted. sorry
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2021-04-20 15:11:45 +10:00
|
|
|
Cache.Clear(EntityTypeCacheKey);
|
2016-06-01 14:31:33 +02:00
|
|
|
}
|
|
|
|
|
catch
|
|
|
|
|
{
|
|
|
|
|
// if an exception is thrown we need to remove the entry from cache,
|
|
|
|
|
// this is ONLY a work around because of the way
|
|
|
|
|
// that we cache entities: http://issues.umbraco.org/issue/U4-4259
|
2019-01-17 11:01:23 +01:00
|
|
|
Cache.Clear(GetEntityCacheKey(entity.Id));
|
2016-06-01 14:31:33 +02:00
|
|
|
|
|
|
|
|
// if there's a GetAllCacheAllowZeroCount cache, ensure it is cleared
|
Implements Public Access in netcore (#10137)
* Getting new netcore PublicAccessChecker in place
* Adds full test coverage for PublicAccessChecker
* remove PublicAccessComposer
* adjust namespaces, ensure RoleManager works, separate public access controller, reduce content controller
* Implements the required methods on IMemberManager, removes old migrated code
* Updates routing to be able to re-route, Fixes middleware ordering ensuring endpoints are last, refactors pipeline options, adds public access middleware, ensures public access follows all hops
* adds note
* adds note
* Cleans up ext methods, ensures that members identity is added on both front-end and back ends. updates how UmbracoApplicationBuilder works in that it explicitly starts endpoints at the time of calling.
* Changes name to IUmbracoEndpointBuilder
* adds note
* Fixing tests, fixing error describers so there's 2x one for back office, one for members, fixes TryConvertTo, fixes login redirect
* fixing build
* Fixes keepalive, fixes PublicAccessMiddleware to not throw, updates startup code to be more clear and removes magic that registers middleware.
* adds note
* removes unused filter, fixes build
* fixes WebPath and tests
* Looks up entities in one query
* remove usings
* Fix test, remove stylesheet
* Set status code before we write to response to avoid error
* Ensures that users and members are validated when logging in. Shares more code between users and members.
* Fixes RepositoryCacheKeys to ensure the keys are normalized
* oops didn't mean to commit this
* Fix casing issues with caching, stop boxing value types for all cache operations, stop re-creating string keys in DefaultRepositoryCachePolicy
* bah, far out this keeps getting recommitted. sorry
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2021-04-20 15:11:45 +10:00
|
|
|
Cache.Clear(EntityTypeCacheKey);
|
2016-06-01 14:31:33 +02:00
|
|
|
|
|
|
|
|
throw;
|
|
|
|
|
}
|
2016-06-01 10:35:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
2016-06-01 14:31:33 +02:00
|
|
|
public override void Update(TEntity entity, Action<TEntity> persistUpdated)
|
2016-06-01 10:35:44 +02:00
|
|
|
{
|
|
|
|
|
if (entity == null) throw new ArgumentNullException(nameof(entity));
|
2016-01-14 18:11:48 +01:00
|
|
|
|
2016-01-07 16:31:20 +01:00
|
|
|
try
|
|
|
|
|
{
|
2016-06-01 14:31:33 +02:00
|
|
|
persistUpdated(entity);
|
2016-01-07 16:31:20 +01:00
|
|
|
|
2016-06-01 14:31:33 +02:00
|
|
|
// just to be safe, we cannot cache an item without an identity
|
|
|
|
|
if (entity.HasIdentity)
|
2016-01-07 17:54:55 +01:00
|
|
|
{
|
2019-01-17 11:01:23 +01:00
|
|
|
Cache.Insert(GetEntityCacheKey(entity.Id), () => entity, TimeSpan.FromMinutes(5), true);
|
2016-06-01 14:31:33 +02:00
|
|
|
}
|
2016-06-01 10:35:44 +02:00
|
|
|
|
2016-06-01 14:31:33 +02:00
|
|
|
// if there's a GetAllCacheAllowZeroCount cache, ensure it is cleared
|
Implements Public Access in netcore (#10137)
* Getting new netcore PublicAccessChecker in place
* Adds full test coverage for PublicAccessChecker
* remove PublicAccessComposer
* adjust namespaces, ensure RoleManager works, separate public access controller, reduce content controller
* Implements the required methods on IMemberManager, removes old migrated code
* Updates routing to be able to re-route, Fixes middleware ordering ensuring endpoints are last, refactors pipeline options, adds public access middleware, ensures public access follows all hops
* adds note
* adds note
* Cleans up ext methods, ensures that members identity is added on both front-end and back ends. updates how UmbracoApplicationBuilder works in that it explicitly starts endpoints at the time of calling.
* Changes name to IUmbracoEndpointBuilder
* adds note
* Fixing tests, fixing error describers so there's 2x one for back office, one for members, fixes TryConvertTo, fixes login redirect
* fixing build
* Fixes keepalive, fixes PublicAccessMiddleware to not throw, updates startup code to be more clear and removes magic that registers middleware.
* adds note
* removes unused filter, fixes build
* fixes WebPath and tests
* Looks up entities in one query
* remove usings
* Fix test, remove stylesheet
* Set status code before we write to response to avoid error
* Ensures that users and members are validated when logging in. Shares more code between users and members.
* Fixes RepositoryCacheKeys to ensure the keys are normalized
* oops didn't mean to commit this
* Fix casing issues with caching, stop boxing value types for all cache operations, stop re-creating string keys in DefaultRepositoryCachePolicy
* bah, far out this keeps getting recommitted. sorry
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2021-04-20 15:11:45 +10:00
|
|
|
Cache.Clear(EntityTypeCacheKey);
|
2016-01-07 16:31:20 +01:00
|
|
|
}
|
|
|
|
|
catch
|
|
|
|
|
{
|
2016-06-01 14:31:33 +02:00
|
|
|
// if an exception is thrown we need to remove the entry from cache,
|
|
|
|
|
// this is ONLY a work around because of the way
|
|
|
|
|
// that we cache entities: http://issues.umbraco.org/issue/U4-4259
|
2019-01-17 11:01:23 +01:00
|
|
|
Cache.Clear(GetEntityCacheKey(entity.Id));
|
2016-01-07 16:31:20 +01:00
|
|
|
|
2016-06-01 14:31:33 +02:00
|
|
|
// if there's a GetAllCacheAllowZeroCount cache, ensure it is cleared
|
Implements Public Access in netcore (#10137)
* Getting new netcore PublicAccessChecker in place
* Adds full test coverage for PublicAccessChecker
* remove PublicAccessComposer
* adjust namespaces, ensure RoleManager works, separate public access controller, reduce content controller
* Implements the required methods on IMemberManager, removes old migrated code
* Updates routing to be able to re-route, Fixes middleware ordering ensuring endpoints are last, refactors pipeline options, adds public access middleware, ensures public access follows all hops
* adds note
* adds note
* Cleans up ext methods, ensures that members identity is added on both front-end and back ends. updates how UmbracoApplicationBuilder works in that it explicitly starts endpoints at the time of calling.
* Changes name to IUmbracoEndpointBuilder
* adds note
* Fixing tests, fixing error describers so there's 2x one for back office, one for members, fixes TryConvertTo, fixes login redirect
* fixing build
* Fixes keepalive, fixes PublicAccessMiddleware to not throw, updates startup code to be more clear and removes magic that registers middleware.
* adds note
* removes unused filter, fixes build
* fixes WebPath and tests
* Looks up entities in one query
* remove usings
* Fix test, remove stylesheet
* Set status code before we write to response to avoid error
* Ensures that users and members are validated when logging in. Shares more code between users and members.
* Fixes RepositoryCacheKeys to ensure the keys are normalized
* oops didn't mean to commit this
* Fix casing issues with caching, stop boxing value types for all cache operations, stop re-creating string keys in DefaultRepositoryCachePolicy
* bah, far out this keeps getting recommitted. sorry
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2021-04-20 15:11:45 +10:00
|
|
|
Cache.Clear(EntityTypeCacheKey);
|
2016-06-01 10:35:44 +02:00
|
|
|
|
2016-01-07 16:31:20 +01:00
|
|
|
throw;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-01 10:35:44 +02:00
|
|
|
/// <inheritdoc />
|
2016-06-01 14:31:33 +02:00
|
|
|
public override void Delete(TEntity entity, Action<TEntity> persistDeleted)
|
2016-01-07 16:31:20 +01:00
|
|
|
{
|
2016-06-01 10:35:44 +02:00
|
|
|
if (entity == null) throw new ArgumentNullException(nameof(entity));
|
2016-01-14 18:11:48 +01:00
|
|
|
|
2016-02-02 00:47:18 +01:00
|
|
|
try
|
|
|
|
|
{
|
2016-06-01 14:31:33 +02:00
|
|
|
persistDeleted(entity);
|
2016-02-02 00:47:18 +01:00
|
|
|
}
|
|
|
|
|
finally
|
2016-01-07 17:54:55 +01:00
|
|
|
{
|
2016-06-01 10:35:44 +02:00
|
|
|
// whatever happens, clear the cache
|
|
|
|
|
var cacheKey = GetEntityCacheKey(entity.Id);
|
2019-01-17 11:01:23 +01:00
|
|
|
Cache.Clear(cacheKey);
|
2016-06-01 14:31:33 +02:00
|
|
|
// if there's a GetAllCacheAllowZeroCount cache, ensure it is cleared
|
Implements Public Access in netcore (#10137)
* Getting new netcore PublicAccessChecker in place
* Adds full test coverage for PublicAccessChecker
* remove PublicAccessComposer
* adjust namespaces, ensure RoleManager works, separate public access controller, reduce content controller
* Implements the required methods on IMemberManager, removes old migrated code
* Updates routing to be able to re-route, Fixes middleware ordering ensuring endpoints are last, refactors pipeline options, adds public access middleware, ensures public access follows all hops
* adds note
* adds note
* Cleans up ext methods, ensures that members identity is added on both front-end and back ends. updates how UmbracoApplicationBuilder works in that it explicitly starts endpoints at the time of calling.
* Changes name to IUmbracoEndpointBuilder
* adds note
* Fixing tests, fixing error describers so there's 2x one for back office, one for members, fixes TryConvertTo, fixes login redirect
* fixing build
* Fixes keepalive, fixes PublicAccessMiddleware to not throw, updates startup code to be more clear and removes magic that registers middleware.
* adds note
* removes unused filter, fixes build
* fixes WebPath and tests
* Looks up entities in one query
* remove usings
* Fix test, remove stylesheet
* Set status code before we write to response to avoid error
* Ensures that users and members are validated when logging in. Shares more code between users and members.
* Fixes RepositoryCacheKeys to ensure the keys are normalized
* oops didn't mean to commit this
* Fix casing issues with caching, stop boxing value types for all cache operations, stop re-creating string keys in DefaultRepositoryCachePolicy
* bah, far out this keeps getting recommitted. sorry
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2021-04-20 15:11:45 +10:00
|
|
|
Cache.Clear(EntityTypeCacheKey);
|
2016-02-02 00:47:18 +01:00
|
|
|
}
|
2016-01-07 16:31:20 +01:00
|
|
|
}
|
|
|
|
|
|
2016-06-01 10:35:44 +02:00
|
|
|
/// <inheritdoc />
|
2022-02-24 10:22:20 +01:00
|
|
|
public override TEntity? Get(TId? id, Func<TId?, TEntity?> performGet, Func<TId[]?, IEnumerable<TEntity>?> performGetAll)
|
2016-01-07 16:31:20 +01:00
|
|
|
{
|
2016-06-01 10:35:44 +02:00
|
|
|
var cacheKey = GetEntityCacheKey(id);
|
2016-01-07 16:31:20 +01:00
|
|
|
var fromCache = Cache.GetCacheItem<TEntity>(cacheKey);
|
2016-06-01 10:35:44 +02:00
|
|
|
|
|
|
|
|
// if found in cache then return else fetch and cache
|
2016-01-07 16:31:20 +01:00
|
|
|
if (fromCache != null)
|
Implements Public Access in netcore (#10137)
* Getting new netcore PublicAccessChecker in place
* Adds full test coverage for PublicAccessChecker
* remove PublicAccessComposer
* adjust namespaces, ensure RoleManager works, separate public access controller, reduce content controller
* Implements the required methods on IMemberManager, removes old migrated code
* Updates routing to be able to re-route, Fixes middleware ordering ensuring endpoints are last, refactors pipeline options, adds public access middleware, ensures public access follows all hops
* adds note
* adds note
* Cleans up ext methods, ensures that members identity is added on both front-end and back ends. updates how UmbracoApplicationBuilder works in that it explicitly starts endpoints at the time of calling.
* Changes name to IUmbracoEndpointBuilder
* adds note
* Fixing tests, fixing error describers so there's 2x one for back office, one for members, fixes TryConvertTo, fixes login redirect
* fixing build
* Fixes keepalive, fixes PublicAccessMiddleware to not throw, updates startup code to be more clear and removes magic that registers middleware.
* adds note
* removes unused filter, fixes build
* fixes WebPath and tests
* Looks up entities in one query
* remove usings
* Fix test, remove stylesheet
* Set status code before we write to response to avoid error
* Ensures that users and members are validated when logging in. Shares more code between users and members.
* Fixes RepositoryCacheKeys to ensure the keys are normalized
* oops didn't mean to commit this
* Fix casing issues with caching, stop boxing value types for all cache operations, stop re-creating string keys in DefaultRepositoryCachePolicy
* bah, far out this keeps getting recommitted. sorry
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2021-04-20 15:11:45 +10:00
|
|
|
{
|
2016-01-07 16:31:20 +01:00
|
|
|
return fromCache;
|
Implements Public Access in netcore (#10137)
* Getting new netcore PublicAccessChecker in place
* Adds full test coverage for PublicAccessChecker
* remove PublicAccessComposer
* adjust namespaces, ensure RoleManager works, separate public access controller, reduce content controller
* Implements the required methods on IMemberManager, removes old migrated code
* Updates routing to be able to re-route, Fixes middleware ordering ensuring endpoints are last, refactors pipeline options, adds public access middleware, ensures public access follows all hops
* adds note
* adds note
* Cleans up ext methods, ensures that members identity is added on both front-end and back ends. updates how UmbracoApplicationBuilder works in that it explicitly starts endpoints at the time of calling.
* Changes name to IUmbracoEndpointBuilder
* adds note
* Fixing tests, fixing error describers so there's 2x one for back office, one for members, fixes TryConvertTo, fixes login redirect
* fixing build
* Fixes keepalive, fixes PublicAccessMiddleware to not throw, updates startup code to be more clear and removes magic that registers middleware.
* adds note
* removes unused filter, fixes build
* fixes WebPath and tests
* Looks up entities in one query
* remove usings
* Fix test, remove stylesheet
* Set status code before we write to response to avoid error
* Ensures that users and members are validated when logging in. Shares more code between users and members.
* Fixes RepositoryCacheKeys to ensure the keys are normalized
* oops didn't mean to commit this
* Fix casing issues with caching, stop boxing value types for all cache operations, stop re-creating string keys in DefaultRepositoryCachePolicy
* bah, far out this keeps getting recommitted. sorry
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2021-04-20 15:11:45 +10:00
|
|
|
}
|
|
|
|
|
|
2016-06-01 14:31:33 +02:00
|
|
|
var entity = performGet(id);
|
2016-01-07 16:31:20 +01:00
|
|
|
|
2016-06-01 10:35:44 +02:00
|
|
|
if (entity != null && entity.HasIdentity)
|
Implements Public Access in netcore (#10137)
* Getting new netcore PublicAccessChecker in place
* Adds full test coverage for PublicAccessChecker
* remove PublicAccessComposer
* adjust namespaces, ensure RoleManager works, separate public access controller, reduce content controller
* Implements the required methods on IMemberManager, removes old migrated code
* Updates routing to be able to re-route, Fixes middleware ordering ensuring endpoints are last, refactors pipeline options, adds public access middleware, ensures public access follows all hops
* adds note
* adds note
* Cleans up ext methods, ensures that members identity is added on both front-end and back ends. updates how UmbracoApplicationBuilder works in that it explicitly starts endpoints at the time of calling.
* Changes name to IUmbracoEndpointBuilder
* adds note
* Fixing tests, fixing error describers so there's 2x one for back office, one for members, fixes TryConvertTo, fixes login redirect
* fixing build
* Fixes keepalive, fixes PublicAccessMiddleware to not throw, updates startup code to be more clear and removes magic that registers middleware.
* adds note
* removes unused filter, fixes build
* fixes WebPath and tests
* Looks up entities in one query
* remove usings
* Fix test, remove stylesheet
* Set status code before we write to response to avoid error
* Ensures that users and members are validated when logging in. Shares more code between users and members.
* Fixes RepositoryCacheKeys to ensure the keys are normalized
* oops didn't mean to commit this
* Fix casing issues with caching, stop boxing value types for all cache operations, stop re-creating string keys in DefaultRepositoryCachePolicy
* bah, far out this keeps getting recommitted. sorry
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2021-04-20 15:11:45 +10:00
|
|
|
{
|
2016-06-01 14:31:33 +02:00
|
|
|
InsertEntity(cacheKey, entity);
|
Implements Public Access in netcore (#10137)
* Getting new netcore PublicAccessChecker in place
* Adds full test coverage for PublicAccessChecker
* remove PublicAccessComposer
* adjust namespaces, ensure RoleManager works, separate public access controller, reduce content controller
* Implements the required methods on IMemberManager, removes old migrated code
* Updates routing to be able to re-route, Fixes middleware ordering ensuring endpoints are last, refactors pipeline options, adds public access middleware, ensures public access follows all hops
* adds note
* adds note
* Cleans up ext methods, ensures that members identity is added on both front-end and back ends. updates how UmbracoApplicationBuilder works in that it explicitly starts endpoints at the time of calling.
* Changes name to IUmbracoEndpointBuilder
* adds note
* Fixing tests, fixing error describers so there's 2x one for back office, one for members, fixes TryConvertTo, fixes login redirect
* fixing build
* Fixes keepalive, fixes PublicAccessMiddleware to not throw, updates startup code to be more clear and removes magic that registers middleware.
* adds note
* removes unused filter, fixes build
* fixes WebPath and tests
* Looks up entities in one query
* remove usings
* Fix test, remove stylesheet
* Set status code before we write to response to avoid error
* Ensures that users and members are validated when logging in. Shares more code between users and members.
* Fixes RepositoryCacheKeys to ensure the keys are normalized
* oops didn't mean to commit this
* Fix casing issues with caching, stop boxing value types for all cache operations, stop re-creating string keys in DefaultRepositoryCachePolicy
* bah, far out this keeps getting recommitted. sorry
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2021-04-20 15:11:45 +10:00
|
|
|
}
|
2016-01-07 16:31:20 +01:00
|
|
|
|
|
|
|
|
return entity;
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-01 10:35:44 +02:00
|
|
|
/// <inheritdoc />
|
2022-02-18 14:32:51 +01:00
|
|
|
public override TEntity? GetCached(TId id)
|
2016-01-07 16:31:20 +01:00
|
|
|
{
|
2016-06-01 10:35:44 +02:00
|
|
|
var cacheKey = GetEntityCacheKey(id);
|
2016-01-07 16:31:20 +01:00
|
|
|
return Cache.GetCacheItem<TEntity>(cacheKey);
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-01 10:35:44 +02:00
|
|
|
/// <inheritdoc />
|
2022-02-24 10:22:20 +01:00
|
|
|
public override bool Exists(TId id, Func<TId, bool> performExists, Func<TId[], IEnumerable<TEntity>?> performGetAll)
|
2016-01-07 16:31:20 +01:00
|
|
|
{
|
2016-06-01 10:35:44 +02:00
|
|
|
// if found in cache the return else check
|
|
|
|
|
var cacheKey = GetEntityCacheKey(id);
|
2016-01-07 16:31:20 +01:00
|
|
|
var fromCache = Cache.GetCacheItem<TEntity>(cacheKey);
|
2016-06-01 14:31:33 +02:00
|
|
|
return fromCache != null || performExists(id);
|
2016-01-07 16:31:20 +01:00
|
|
|
}
|
|
|
|
|
|
2016-06-01 10:35:44 +02:00
|
|
|
/// <inheritdoc />
|
2022-02-24 10:22:20 +01:00
|
|
|
public override TEntity[] GetAll(TId[]? ids, Func<TId[]?, IEnumerable<TEntity>?> performGetAll)
|
2016-01-07 16:31:20 +01:00
|
|
|
{
|
2022-02-24 10:22:20 +01:00
|
|
|
if (ids?.Length > 0)
|
2016-01-07 16:31:20 +01:00
|
|
|
{
|
2016-06-01 10:35:44 +02:00
|
|
|
// try to get each entity from the cache
|
|
|
|
|
// if we can find all of them, return
|
2016-06-01 14:31:33 +02:00
|
|
|
var entities = ids.Select(GetCached).WhereNotNull().ToArray();
|
2016-06-01 10:35:44 +02:00
|
|
|
if (ids.Length.Equals(entities.Length))
|
|
|
|
|
return entities; // no need for null checks, we are not caching nulls
|
2016-01-07 16:31:20 +01:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2016-06-01 10:35:44 +02:00
|
|
|
// get everything we have
|
2022-02-24 10:22:20 +01:00
|
|
|
var entities = Cache.GetCacheItemsByKeySearch<TEntity>(EntityTypeCacheKey)?
|
2016-06-01 10:35:44 +02:00
|
|
|
.ToArray(); // no need for null checks, we are not caching nulls
|
|
|
|
|
|
2022-02-24 10:22:20 +01:00
|
|
|
if (entities?.Length > 0)
|
2016-01-07 16:31:20 +01:00
|
|
|
{
|
2016-06-01 10:35:44 +02:00
|
|
|
// if some of them were in the cache...
|
2016-01-07 16:31:20 +01:00
|
|
|
if (_options.GetAllCacheValidateCount)
|
|
|
|
|
{
|
2016-06-01 10:35:44 +02:00
|
|
|
// need to validate the count, get the actual count and return if ok
|
2022-02-18 14:32:51 +01:00
|
|
|
if (_options.PerformCount is not null)
|
|
|
|
|
{
|
|
|
|
|
var totalCount = _options.PerformCount();
|
|
|
|
|
if (entities.Length == totalCount)
|
2022-02-24 10:22:20 +01:00
|
|
|
return entities.WhereNotNull().ToArray();
|
2022-02-18 14:32:51 +01:00
|
|
|
}
|
2016-01-07 16:31:20 +01:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2016-06-01 10:35:44 +02:00
|
|
|
// no need to validate, just return what we have and assume it's all there is
|
2022-02-24 10:22:20 +01:00
|
|
|
return entities.WhereNotNull().ToArray();
|
2016-01-07 16:31:20 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (_options.GetAllCacheAllowZeroCount)
|
|
|
|
|
{
|
2016-06-01 10:35:44 +02:00
|
|
|
// if none of them were in the cache
|
|
|
|
|
// and we allow zero count - check for the special (empty) entry
|
Implements Public Access in netcore (#10137)
* Getting new netcore PublicAccessChecker in place
* Adds full test coverage for PublicAccessChecker
* remove PublicAccessComposer
* adjust namespaces, ensure RoleManager works, separate public access controller, reduce content controller
* Implements the required methods on IMemberManager, removes old migrated code
* Updates routing to be able to re-route, Fixes middleware ordering ensuring endpoints are last, refactors pipeline options, adds public access middleware, ensures public access follows all hops
* adds note
* adds note
* Cleans up ext methods, ensures that members identity is added on both front-end and back ends. updates how UmbracoApplicationBuilder works in that it explicitly starts endpoints at the time of calling.
* Changes name to IUmbracoEndpointBuilder
* adds note
* Fixing tests, fixing error describers so there's 2x one for back office, one for members, fixes TryConvertTo, fixes login redirect
* fixing build
* Fixes keepalive, fixes PublicAccessMiddleware to not throw, updates startup code to be more clear and removes magic that registers middleware.
* adds note
* removes unused filter, fixes build
* fixes WebPath and tests
* Looks up entities in one query
* remove usings
* Fix test, remove stylesheet
* Set status code before we write to response to avoid error
* Ensures that users and members are validated when logging in. Shares more code between users and members.
* Fixes RepositoryCacheKeys to ensure the keys are normalized
* oops didn't mean to commit this
* Fix casing issues with caching, stop boxing value types for all cache operations, stop re-creating string keys in DefaultRepositoryCachePolicy
* bah, far out this keeps getting recommitted. sorry
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2021-04-20 15:11:45 +10:00
|
|
|
var empty = Cache.GetCacheItem<TEntity[]>(EntityTypeCacheKey);
|
2016-06-01 10:35:44 +02:00
|
|
|
if (empty != null) return empty;
|
2016-01-07 16:31:20 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-01 10:35:44 +02:00
|
|
|
// cache failed, get from repo and cache
|
2022-02-24 10:22:20 +01:00
|
|
|
var repoEntities = performGetAll(ids)?
|
2016-06-01 10:35:44 +02:00
|
|
|
.WhereNotNull() // exclude nulls!
|
|
|
|
|
.Where(x => x.HasIdentity) // be safe, though would be weird...
|
2016-01-07 16:31:20 +01:00
|
|
|
.ToArray();
|
|
|
|
|
|
2016-06-01 10:35:44 +02:00
|
|
|
// note: if empty & allow zero count, will cache a special (empty) entry
|
2016-06-01 14:31:33 +02:00
|
|
|
InsertEntities(ids, repoEntities);
|
2016-01-07 16:31:20 +01:00
|
|
|
|
2022-02-24 10:22:20 +01:00
|
|
|
return repoEntities ?? Array.Empty<TEntity>();
|
2016-01-07 16:31:20 +01:00
|
|
|
}
|
2016-06-01 14:31:33 +02:00
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
|
public override void ClearAll()
|
|
|
|
|
{
|
Implements Public Access in netcore (#10137)
* Getting new netcore PublicAccessChecker in place
* Adds full test coverage for PublicAccessChecker
* remove PublicAccessComposer
* adjust namespaces, ensure RoleManager works, separate public access controller, reduce content controller
* Implements the required methods on IMemberManager, removes old migrated code
* Updates routing to be able to re-route, Fixes middleware ordering ensuring endpoints are last, refactors pipeline options, adds public access middleware, ensures public access follows all hops
* adds note
* adds note
* Cleans up ext methods, ensures that members identity is added on both front-end and back ends. updates how UmbracoApplicationBuilder works in that it explicitly starts endpoints at the time of calling.
* Changes name to IUmbracoEndpointBuilder
* adds note
* Fixing tests, fixing error describers so there's 2x one for back office, one for members, fixes TryConvertTo, fixes login redirect
* fixing build
* Fixes keepalive, fixes PublicAccessMiddleware to not throw, updates startup code to be more clear and removes magic that registers middleware.
* adds note
* removes unused filter, fixes build
* fixes WebPath and tests
* Looks up entities in one query
* remove usings
* Fix test, remove stylesheet
* Set status code before we write to response to avoid error
* Ensures that users and members are validated when logging in. Shares more code between users and members.
* Fixes RepositoryCacheKeys to ensure the keys are normalized
* oops didn't mean to commit this
* Fix casing issues with caching, stop boxing value types for all cache operations, stop re-creating string keys in DefaultRepositoryCachePolicy
* bah, far out this keeps getting recommitted. sorry
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2021-04-20 15:11:45 +10:00
|
|
|
Cache.ClearByKey(EntityTypeCacheKey);
|
2016-06-01 14:31:33 +02:00
|
|
|
}
|
2016-01-07 16:31:20 +01:00
|
|
|
}
|
2017-07-20 11:21:28 +02:00
|
|
|
}
|