diff --git a/Finch.Sqlite/Operations/IEntityModifiedHandler.cs b/Finch.Sqlite/Operations/IEntityModifiedHandler.cs deleted file mode 100644 index ce3b8f27..00000000 --- a/Finch.Sqlite/Operations/IEntityModifiedHandler.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System.Threading.Tasks; -using Finch.Communication; -using Finch.Models; - -namespace Finch.Sqlite; - -public interface IEntityModifiedHandler : IHandler -{ - Task Saved(T model, bool update) where T : FinchIdEntity, new() => update ? Updated(model) : Created(model); - Task Created(T model) where T : FinchIdEntity, new(); - Task Updated(T model) where T : FinchIdEntity, new(); - Task Deleted(T model) where T : FinchIdEntity, new(); -} - - -public class EmptyEntityModifiedHandler : IEntityModifiedHandler -{ - public Task Created(T model) where T : FinchIdEntity, new() => Task.CompletedTask; - public Task Updated(T model) where T : FinchIdEntity, new() => Task.CompletedTask; - public Task Deleted(T model) where T : FinchIdEntity, new() => Task.CompletedTask; -} \ No newline at end of file diff --git a/Finch.Sqlite/Operations/StoreContext.cs b/Finch.Sqlite/Operations/StoreContext.cs deleted file mode 100644 index f3643733..00000000 --- a/Finch.Sqlite/Operations/StoreContext.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using Finch.Communication; -using Finch.Configuration; -using Finch.Context; - -namespace Finch.Sqlite; - -public class StoreContext -{ - public IFinchContext Context { get; private set; } - - public IFinchOptions Options { get; private set; } - - public IServiceProvider Services { get; private set; } - - public IMessageAggregator Messages { get; private set; } - - - public StoreContext(IFinchContext context, IServiceProvider serviceProvider, IMessageAggregator messages) - { - Options = context.Options; - Context = context; - Services = serviceProvider; - Messages = messages; - } -} \ No newline at end of file diff --git a/Finch/Assemblies/FinchAssemblyDiscoveryRule.cs b/Finch/Assemblies/FinchAssemblyDiscoveryRule.cs deleted file mode 100644 index c78f1906..00000000 --- a/Finch/Assemblies/FinchAssemblyDiscoveryRule.cs +++ /dev/null @@ -1,16 +0,0 @@ -using Microsoft.Extensions.DependencyModel; - -namespace Finch.Assemblies; - -public class FinchAssemblyDiscoveryRule : IAssemblyDiscoveryRule -{ - const string FinchPrefix = "Finch."; - - /// - public bool IsValid(RuntimeLibrary library, AssemblyDiscoveryContext context) - { - StringComparison casing = StringComparison.OrdinalIgnoreCase; - // TODO we need to auto-add assemblies and discover their types which have implementations of IFinchPlugin - return library.Name.StartsWith(FinchPrefix, casing) || (context.HasEntryAssembly && library.Name.Contains(context.EntryAssemblyName, casing)); - } -} \ No newline at end of file diff --git a/Finch/Communication/Handlers/IHandler.cs b/Finch/Communication/Handlers/IHandler.cs deleted file mode 100644 index 93354209..00000000 --- a/Finch/Communication/Handlers/IHandler.cs +++ /dev/null @@ -1,5 +0,0 @@ -namespace Finch.Communication; - -public interface IHandler -{ -} diff --git a/Finch/Configuration/IFinchCollectionOptions.cs b/Finch/Configuration/IFinchCollectionOptions.cs deleted file mode 100644 index 389b68a5..00000000 --- a/Finch/Configuration/IFinchCollectionOptions.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Finch.Configuration; - -public interface IFinchCollectionOptions -{ - -} \ No newline at end of file diff --git a/Finch/Context/FinchContextMiddleware.cs b/Finch/Context/FinchContextMiddleware.cs deleted file mode 100644 index f324d3b9..00000000 --- a/Finch/Context/FinchContextMiddleware.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Microsoft.AspNetCore.Http; - -namespace Finch.Context -{ - public class FinchContextMiddleware(RequestDelegate next) - { - public async Task Invoke(HttpContext httpContext, IFinchContext finchContext) - { - await finchContext.Resolve(httpContext); - await next(httpContext); - } - } -} diff --git a/Finch/FileStorage/FileSystemOptions.cs b/Finch/FileStorage/FileSystemOptions.cs deleted file mode 100644 index 93cd82fe..00000000 --- a/Finch/FileStorage/FileSystemOptions.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Finch.FileStorage; - -public class FileSystemOptions -{ - public string FinchAssetsPath { get; set; } -} \ No newline at end of file diff --git a/Finch/Models/FinchReference.cs b/Finch/Models/FinchReference.cs deleted file mode 100644 index b9569419..00000000 --- a/Finch/Models/FinchReference.cs +++ /dev/null @@ -1,30 +0,0 @@ -namespace Finch.Models; - -public class FinchReference -{ - public FinchReference() { } - - public FinchReference(FinchEntity entity) - { - Id = entity.Id; - Name = entity.Name; - } - - public static FinchReference From(FinchEntity entity) - { - return entity == null ? null : new FinchReference(entity); - } - - public static FinchReference From(T entity, Func transform) where T : FinchEntity - { - return entity == null ? null : new FinchReference() - { - Id = entity.Id, - Name = transform(entity) - }; - } - - public string Id { get; set; } - - public string Name { get; set; } -} diff --git a/Finch/Mvc/FinchApiController.cs b/Finch/Mvc/FinchApiController.cs deleted file mode 100644 index c07a46dd..00000000 --- a/Finch/Mvc/FinchApiController.cs +++ /dev/null @@ -1,11 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.DependencyInjection; - -namespace Finch.Mvc; - -[ApiController] -public abstract class FinchApiController : ControllerBase -{ - IFinchContext _context; - public IFinchContext Context => _context ?? (_context = HttpContext?.RequestServices?.GetService()); -} \ No newline at end of file diff --git a/Finch/Mvc/FinchController.cs b/Finch/Mvc/FinchController.cs deleted file mode 100644 index b9637545..00000000 --- a/Finch/Mvc/FinchController.cs +++ /dev/null @@ -1,10 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.DependencyInjection; - -namespace Finch.Mvc; - -public abstract class FinchController : Controller -{ - IFinchContext _context; - public IFinchContext Context => _context ?? (_context = HttpContext?.RequestServices?.GetService()); -} \ No newline at end of file diff --git a/Finch/ServiceCollectionExtensions.cs b/Finch/ServiceCollectionExtensions.cs deleted file mode 100644 index 3f42d4e3..00000000 --- a/Finch/ServiceCollectionExtensions.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; - -namespace Finch; - -public static class ServiceCollectionExtensions -{ - public static FinchBuilder AddFinch(this IServiceCollection services, IConfiguration configuration) - { - return new FinchBuilder(services, configuration, null); - } - - public static FinchBuilder AddFinch(this IServiceCollection services, IConfiguration configuration, Action setupAction) - { - return new FinchBuilder(services, configuration, setupAction); - } -} \ No newline at end of file diff --git a/Finch/Usings.cs b/Finch/Usings.cs deleted file mode 100644 index cf0aa4ad..00000000 --- a/Finch/Usings.cs +++ /dev/null @@ -1,22 +0,0 @@ - -global using System; -global using System.Collections; -global using System.Collections.Generic; -global using System.Linq; -global using System.Threading; -global using System.Threading.Tasks; - -//global using Finch.Persistence; -global using Finch.Utils; -global using Finch.Configuration; -global using Finch.Extensions; -global using Finch.FileStorage; -global using Finch.Models; -global using Finch.Modules; -global using Finch.Media; -global using Finch.Rendering; -global using Finch.Validation; -global using Finch.Localization; -global using Finch.Context; -global using Finch.Communication; -global using Finch.Assemblies; diff --git a/Finch.Raven/DbProviders/RavenIdentityStoreDbProvider.cs b/mixtape.Raven/DbProviders/RavenIdentityStoreDbProvider.cs similarity index 68% rename from Finch.Raven/DbProviders/RavenIdentityStoreDbProvider.cs rename to mixtape.Raven/DbProviders/RavenIdentityStoreDbProvider.cs index a0bd7045..7f047af4 100644 --- a/Finch.Raven/DbProviders/RavenIdentityStoreDbProvider.cs +++ b/mixtape.Raven/DbProviders/RavenIdentityStoreDbProvider.cs @@ -1,9 +1,9 @@ using System.Linq.Expressions; -using Finch.Identity; +using Mixtape.Identity; -namespace Finch.Raven; +namespace Mixtape.Raven; -public class RavenIdentityStoreDbProvider : IFinchIdentityStoreDbProvider +public class RavenIdentityStoreDbProvider : IMixtapeIdentityStoreDbProvider { protected IRavenOperations Ops { get; set; } @@ -14,27 +14,27 @@ public class RavenIdentityStoreDbProvider : IFinchIdentityStoreDbProvider } - public Task Load(string id, CancellationToken ct = default) where T : FinchEntity, new() => + public Task Load(string id, CancellationToken ct = default) where T : MixtapeEntity, new() => Ops.Load(id); - public Task Find(Expression> expression, CancellationToken ct = default) where T : FinchEntity => + public Task Find(Expression> expression, CancellationToken ct = default) where T : MixtapeEntity => Ops.Session.Query().FirstOrDefaultAsync(expression, ct); public async Task> FindAll(Expression> expression, CancellationToken ct = default) - where T : FinchEntity => + where T : MixtapeEntity => await Ops.Session.Query().Where(expression).ToListAsync(ct); - public Task> Create(T model, CancellationToken ct = default) where T : FinchEntity, new() => + public Task> Create(T model, CancellationToken ct = default) where T : MixtapeEntity, new() => Ops.Create(model); - public Task> Update(T model, CancellationToken ct = default) where T : FinchEntity, new() => + public Task> Update(T model, CancellationToken ct = default) where T : MixtapeEntity, new() => Ops.Update(model); - public Task> Delete(T model, CancellationToken ct = default) where T : FinchEntity, new() => + public Task> Delete(T model, CancellationToken ct = default) where T : MixtapeEntity, new() => Ops.Delete(model); } \ No newline at end of file diff --git a/Finch.Raven/DbProviders/RavenMediaStoreDbProvider.cs b/mixtape.Raven/DbProviders/RavenMediaStoreDbProvider.cs similarity index 68% rename from Finch.Raven/DbProviders/RavenMediaStoreDbProvider.cs rename to mixtape.Raven/DbProviders/RavenMediaStoreDbProvider.cs index 0d67f8f6..89f72e3f 100644 --- a/Finch.Raven/DbProviders/RavenMediaStoreDbProvider.cs +++ b/mixtape.Raven/DbProviders/RavenMediaStoreDbProvider.cs @@ -1,9 +1,9 @@ using System.Linq.Expressions; -using Finch.Media; +using Mixtape.Media; -namespace Finch.Raven; +namespace Mixtape.Raven; -public class RavenMediaStoreDbProvider : IFinchMediaStoreDbProvider +public class RavenMediaStoreDbProvider : IMixtapeMediaStoreDbProvider { protected IRavenOperations Ops { get; set; } @@ -14,23 +14,23 @@ public class RavenMediaStoreDbProvider : IFinchMediaStoreDbProvider } - public Task Find(Expression> expression, CancellationToken ct = default) where T : FinchEntity => + public Task Find(Expression> expression, CancellationToken ct = default) where T : MixtapeEntity => Ops.Session.Query().FirstOrDefaultAsync(expression, ct); public async Task> FindAll(Expression> expression, CancellationToken ct = default) - where T : FinchEntity => + where T : MixtapeEntity => await Ops.Session.Query().Where(expression).ToListAsync(ct); - public Task> Create(T model, CancellationToken ct = default) where T : FinchEntity, new() => + public Task> Create(T model, CancellationToken ct = default) where T : MixtapeEntity, new() => Ops.Create(model); - public Task> Update(T model, CancellationToken ct = default) where T : FinchEntity, new() => + public Task> Update(T model, CancellationToken ct = default) where T : MixtapeEntity, new() => Ops.Update(model); - public Task> Delete(T model, CancellationToken ct = default) where T : FinchEntity, new() => + public Task> Delete(T model, CancellationToken ct = default) where T : MixtapeEntity, new() => Ops.Delete(model); } \ No newline at end of file diff --git a/Finch.Raven/DbProviders/RavenNumberStoreDbProvider.cs b/mixtape.Raven/DbProviders/RavenNumberStoreDbProvider.cs similarity index 68% rename from Finch.Raven/DbProviders/RavenNumberStoreDbProvider.cs rename to mixtape.Raven/DbProviders/RavenNumberStoreDbProvider.cs index 2b48d17a..bd8a3ca4 100644 --- a/Finch.Raven/DbProviders/RavenNumberStoreDbProvider.cs +++ b/mixtape.Raven/DbProviders/RavenNumberStoreDbProvider.cs @@ -1,9 +1,9 @@ using System.Linq.Expressions; -using Finch.Numbers; +using Mixtape.Numbers; -namespace Finch.Raven; +namespace Mixtape.Raven; -public class RavenNumberStoreDbProvider : IFinchNumberStoreDbProvider +public class RavenNumberStoreDbProvider : IMixtapeNumberStoreDbProvider { protected IRavenOperations Ops { get; set; } @@ -14,27 +14,27 @@ public class RavenNumberStoreDbProvider : IFinchNumberStoreDbProvider } - public Task Load(string id, CancellationToken ct = default) where T : FinchEntity, new() => + public Task Load(string id, CancellationToken ct = default) where T : MixtapeEntity, new() => Ops.Load(id); - public Task Find(Expression> expression, CancellationToken ct = default) where T : FinchEntity => + public Task Find(Expression> expression, CancellationToken ct = default) where T : MixtapeEntity => Ops.Session.Query().FirstOrDefaultAsync(expression, ct); public async Task> FindAll(Expression> expression, CancellationToken ct = default) - where T : FinchEntity => + where T : MixtapeEntity => await Ops.Session.Query().Where(expression).ToListAsync(ct); - public Task> Create(T model, CancellationToken ct = default) where T : FinchEntity, new() => + public Task> Create(T model, CancellationToken ct = default) where T : MixtapeEntity, new() => Ops.Create(model); - public Task> Update(T model, CancellationToken ct = default) where T : FinchEntity, new() => + public Task> Update(T model, CancellationToken ct = default) where T : MixtapeEntity, new() => Ops.Update(model); - public Task> Delete(T model, CancellationToken ct = default) where T : FinchEntity, new() => + public Task> Delete(T model, CancellationToken ct = default) where T : MixtapeEntity, new() => Ops.Delete(model); } \ No newline at end of file diff --git a/Finch.Raven/Extensions/FinchDocumentSessionExtensions.cs b/mixtape.Raven/Extensions/MixtapeDocumentSessionExtensions.cs similarity index 86% rename from Finch.Raven/Extensions/FinchDocumentSessionExtensions.cs rename to mixtape.Raven/Extensions/MixtapeDocumentSessionExtensions.cs index efef28fe..3fb5c111 100644 --- a/Finch.Raven/Extensions/FinchDocumentSessionExtensions.cs +++ b/mixtape.Raven/Extensions/MixtapeDocumentSessionExtensions.cs @@ -1,8 +1,8 @@ using Rv = Raven.Client; -namespace Finch.Raven; +namespace Mixtape.Raven; -public static class FinchDocumentSessionExtensions +public static class MixtapeDocumentSessionExtensions { public static void SetCollection(this IAsyncDocumentSession session, T model, string collectionName) { diff --git a/Finch.Raven/Extensions/RavenQueryableExtensions.cs b/mixtape.Raven/Extensions/RavenQueryableExtensions.cs similarity index 99% rename from Finch.Raven/Extensions/RavenQueryableExtensions.cs rename to mixtape.Raven/Extensions/RavenQueryableExtensions.cs index 27ab0450..ba4edb20 100644 --- a/Finch.Raven/Extensions/RavenQueryableExtensions.cs +++ b/mixtape.Raven/Extensions/RavenQueryableExtensions.cs @@ -1,7 +1,7 @@ using Raven.Client.Documents.Linq; using System.Linq.Expressions; -namespace Finch.Raven; +namespace Mixtape.Raven; public static class RavenQueryableExtensions { diff --git a/Finch.Raven/Extensions/ValidatorExtensions.cs b/mixtape.Raven/Extensions/ValidatorExtensions.cs similarity index 90% rename from Finch.Raven/Extensions/ValidatorExtensions.cs rename to mixtape.Raven/Extensions/ValidatorExtensions.cs index cace20dd..0b69c22d 100644 --- a/Finch.Raven/Extensions/ValidatorExtensions.cs +++ b/mixtape.Raven/Extensions/ValidatorExtensions.cs @@ -1,6 +1,6 @@ using FluentValidation; -namespace Finch.Raven; +namespace Mixtape.Raven; public static class ValidatorExtensions { @@ -8,12 +8,12 @@ public static class ValidatorExtensions /// Check if this value is unique within a collection /// public static IRuleBuilderOptions Unique(this IRuleBuilder ruleBuilder, IRavenOperations ops) - where T : FinchIdEntity + where T : MixtapeIdEntity { return ruleBuilder.MustAsync(async (entity, value, context, cancellation) => { bool any = await ops.Session.Advanced.AsyncDocumentQuery() - .WhereNotEquals(nameof(FinchIdEntity.Id), entity.Id) + .WhereNotEquals(nameof(MixtapeIdEntity.Id), entity.Id) .WhereEquals(context.PropertyPath.ToPascalCaseId(), value) .AnyAsync(cancellation); @@ -42,12 +42,12 @@ public static class ValidatorExtensions /// Check if this value is at least set once to the expected value within a collection /// public static IRuleBuilderOptions ExpectAnyUnique(this IRuleBuilder ruleBuilder, IRavenOperations ops, TProperty expectedValue) - where T : FinchIdEntity + where T : MixtapeIdEntity { return ruleBuilder.MustAsync(async (entity, value, context, cancellation) => { return await ops.Session.Advanced.AsyncDocumentQuery() - .WhereNotEquals(nameof(FinchIdEntity.Id), entity.Id) + .WhereNotEquals(nameof(MixtapeIdEntity.Id), entity.Id) .WhereEquals(context.PropertyPath.ToPascalCaseId(), expectedValue) .AnyAsync(cancellation); }).WithMessage("@errors.forms.not_unique_alone"); @@ -58,7 +58,7 @@ public static class ValidatorExtensions /// Check if this reference exists and is an entity which can be referenced /// public static IRuleBuilderOptions Exists(this IRuleBuilder ruleBuilder, IRavenOperations ops) - where T : FinchIdEntity + where T : MixtapeIdEntity { return ruleBuilder.Exists(ops); } @@ -68,7 +68,7 @@ public static class ValidatorExtensions /// Check if this reference exists and is an entity which can be referenced /// public static IRuleBuilderOptions Exists(this IRuleBuilder ruleBuilder, IRavenOperations ops) - where TCollection : FinchIdEntity + where TCollection : MixtapeIdEntity { return ruleBuilder.MustAsync(async (entity, id, context, cancellation) => { diff --git a/Finch.Raven/Indexes/FinchIndex.cs b/mixtape.Raven/Indexes/MixtapeIndex.cs similarity index 94% rename from Finch.Raven/Indexes/FinchIndex.cs rename to mixtape.Raven/Indexes/MixtapeIndex.cs index e2cc7a73..78f54826 100644 --- a/Finch.Raven/Indexes/FinchIndex.cs +++ b/mixtape.Raven/Indexes/MixtapeIndex.cs @@ -3,15 +3,15 @@ using Raven.Client.Documents.Indexes.Spatial; using Raven.Client.Documents.Operations.Attachments; using System.Linq.Expressions; -namespace Finch.Raven; +namespace Mixtape.Raven; -public abstract class FinchJavascriptIndex : AbstractJavaScriptIndexCreationTask, IFinchIndexDefinition +public abstract class MixtapeJavascriptIndex : AbstractJavaScriptIndexCreationTask, IMixtapeIndexDefinition { - public FinchJavascriptIndex() { Create(); } + public MixtapeJavascriptIndex() { Create(); } protected virtual void Create() { } - public virtual void Setup(IFinchOptions options, IDocumentStore store) { } + public virtual void Setup(IMixtapeOptions options, IDocumentStore store) { } public new string Reduce { get => base.Reduce; set => base.Reduce = value; } public new string OutputReduceToCollection { get => base.OutputReduceToCollection; set => base.OutputReduceToCollection = value; } @@ -43,12 +43,12 @@ public abstract class FinchJavascriptIndex : AbstractJavaScriptIndexCreationTask public new T? TryConvert(object value) where T : struct => base.TryConvert(value); } -public abstract class FinchMultiMapIndex : AbstractMultiMapIndexCreationTask, IFinchIndexDefinition +public abstract class MixtapeMultiMapIndex : AbstractMultiMapIndexCreationTask, IMixtapeIndexDefinition { - public FinchMultiMapIndex() { Create(); } + public MixtapeMultiMapIndex() { Create(); } protected virtual void Create() { } - public virtual void Setup(IFinchOptions options, IDocumentStore store) { } + public virtual void Setup(IMixtapeOptions options, IDocumentStore store) { } // AbstractMultiMapIndexCreationTask public new void AddMap(Expression, IEnumerable>> map) => base.AddMap(map); @@ -110,12 +110,12 @@ public abstract class FinchMultiMapIndex : AbstractMultiMapIndexCreationTask : AbstractMultiMapIndexCreationTask, IFinchIndexDefinition +public abstract class MixtapeMultiMapIndex : AbstractMultiMapIndexCreationTask, IMixtapeIndexDefinition { - public FinchMultiMapIndex() { Create(); } + public MixtapeMultiMapIndex() { Create(); } protected virtual void Create() { } - public virtual void Setup(IFinchOptions options, IDocumentStore store) { } + public virtual void Setup(IMixtapeOptions options, IDocumentStore store) { } // AbstractMultiMapIndexCreationTask public new void AddMap(Expression, IEnumerable>> map) => base.AddMap(map); @@ -177,12 +177,12 @@ public abstract class FinchMultiMapIndex : AbstractMultiMapIndexC } -public abstract class FinchIndex : AbstractIndexCreationTask, IFinchIndexDefinition +public abstract class MixtapeIndex : AbstractIndexCreationTask, IMixtapeIndexDefinition { - public FinchIndex() { Create(); } + public MixtapeIndex() { Create(); } protected virtual void Create() { } - public virtual void Setup(IFinchOptions options, IDocumentStore store) { } + public virtual void Setup(IMixtapeOptions options, IDocumentStore store) { } // AbstractIndexCreationTask public new Expression, IEnumerable>> Map { get => base.Map; set => base.Map = value; } @@ -243,17 +243,17 @@ public abstract class FinchIndex : AbstractIndexCreati } -public abstract class FinchIndex : FinchIndex +public abstract class MixtapeIndex : MixtapeIndex { } -public abstract class FinchIndex : AbstractIndexCreationTask, IFinchIndexDefinition +public abstract class MixtapeIndex : AbstractIndexCreationTask, IMixtapeIndexDefinition { - public FinchIndex() { Create(); } + public MixtapeIndex() { Create(); } protected virtual void Create() { } - public virtual void Setup(IFinchOptions options, IDocumentStore store) { } + public virtual void Setup(IMixtapeOptions options, IDocumentStore store) { } // AbstractIndexCreationTask public new IJsonObject AsJson(object doc) => base.AsJson(doc); @@ -281,7 +281,7 @@ public abstract class FinchIndex : AbstractIndexCreationTask, IFinchIndexDefinit } -public interface IFinchIndexDefinition : IAbstractIndexCreationTask +public interface IMixtapeIndexDefinition : IAbstractIndexCreationTask { - void Setup(IFinchOptions options, IDocumentStore store); + void Setup(IMixtapeOptions options, IDocumentStore store); } diff --git a/Finch.Raven/Indexes/FinchIndexExtensions.cs b/mixtape.Raven/Indexes/MixtapeIndexExtensions.cs similarity index 62% rename from Finch.Raven/Indexes/FinchIndexExtensions.cs rename to mixtape.Raven/Indexes/MixtapeIndexExtensions.cs index 913c0cf5..ca3c4a70 100644 --- a/Finch.Raven/Indexes/FinchIndexExtensions.cs +++ b/mixtape.Raven/Indexes/MixtapeIndexExtensions.cs @@ -1,14 +1,14 @@ -namespace Finch.Raven; +namespace Mixtape.Raven; -public static class FinchIndexExtensions +public static class MixtapeIndexExtensions { - internal static void RunModifiers(this T index, RavenOptions options) where T : IFinchIndexDefinition + internal static void RunModifiers(this T index, RavenOptions options) where T : IMixtapeIndexDefinition { IEnumerable modifiers = options.Indexes.Modifiers.GetAllForType(index.GetType()); foreach (RavenIndexModifiersOptions.Modifier modifier in modifiers) { - Action action = modifier.Modify.Compile(); + Action action = modifier.Modify.Compile(); action.Invoke(index); } } diff --git a/Finch.Raven/Indexes/FinchTreeHierachyIndex.cs b/mixtape.Raven/Indexes/MixtapeTreeHierachyIndex.cs similarity index 59% rename from Finch.Raven/Indexes/FinchTreeHierachyIndex.cs rename to mixtape.Raven/Indexes/MixtapeTreeHierachyIndex.cs index 4918fa50..72908e64 100644 --- a/Finch.Raven/Indexes/FinchTreeHierachyIndex.cs +++ b/mixtape.Raven/Indexes/MixtapeTreeHierachyIndex.cs @@ -1,17 +1,17 @@ using Raven.Client.Documents.Indexes; -namespace Finch.Raven; +namespace Mixtape.Raven; -public class FinchTreeHierarchyIndexResult : FinchIdEntity, ISupportsDbConventions +public class MixtapeTreeHierarchyIndexResult : MixtapeIdEntity, ISupportsDbConventions { public List Path { get; set; } = new List(); } -public abstract class FinchTreeHierarchyIndex : FinchIndex where T : FinchIdEntity, ISupportsTrees +public abstract class MixtapeTreeHierarchyIndex : MixtapeIndex where T : MixtapeIdEntity, ISupportsTrees { protected override void Create() { - Map = items => items.Select(item => new FinchTreeHierarchyIndexResult + Map = items => items.Select(item => new MixtapeTreeHierarchyIndexResult { Id = item.Id, Path = Recurse(item, x => LoadDocument(x.ParentId)) diff --git a/Finch.Raven/Indexes/RavenIndexExtensions.cs b/mixtape.Raven/Indexes/RavenIndexExtensions.cs similarity index 92% rename from Finch.Raven/Indexes/RavenIndexExtensions.cs rename to mixtape.Raven/Indexes/RavenIndexExtensions.cs index 346bca3e..1bea62d0 100644 --- a/Finch.Raven/Indexes/RavenIndexExtensions.cs +++ b/mixtape.Raven/Indexes/RavenIndexExtensions.cs @@ -1,6 +1,6 @@ using Raven.Client.Documents.Indexes; -namespace Finch.Raven; +namespace Mixtape.Raven; public static class RavenIndexExtensions { diff --git a/Finch.Raven/Interceptors/Interceptor.cs b/mixtape.Raven/Interceptors/Interceptor.cs similarity index 65% rename from Finch.Raven/Interceptors/Interceptor.cs rename to mixtape.Raven/Interceptors/Interceptor.cs index 6cf23ea6..8b18a9b0 100644 --- a/Finch.Raven/Interceptors/Interceptor.cs +++ b/mixtape.Raven/Interceptors/Interceptor.cs @@ -1,7 +1,7 @@ -namespace Finch.Raven; +namespace Mixtape.Raven; -public abstract partial class Interceptor : Interceptor, IInterceptor where T : FinchIdEntity +public abstract partial class Interceptor : Interceptor, IInterceptor where T : MixtapeIdEntity { /// public Type ModelType { get; protected set; } @@ -22,51 +22,51 @@ public abstract partial class Interceptor : Interceptor, IInterceptor wher public virtual Task> Creating(InterceptorParameters args, T model) => Task.FromResult>(default); /// - public sealed override async Task> Creating(InterceptorParameters args, FinchIdEntity model) => Convert(await Creating(args, model as T)); + public sealed override async Task> Creating(InterceptorParameters args, MixtapeIdEntity model) => Convert(await Creating(args, model as T)); /// public virtual Task> Updating(InterceptorParameters args, T model) => Task.FromResult>(default); /// - public sealed override async Task> Updating(InterceptorParameters args, FinchIdEntity model) => Convert(await Updating(args, model as T)); + public sealed override async Task> Updating(InterceptorParameters args, MixtapeIdEntity model) => Convert(await Updating(args, model as T)); /// public virtual Task> Deleting(InterceptorParameters args, T model) => Task.FromResult>(default); /// - public sealed override async Task> Deleting(InterceptorParameters args, FinchIdEntity model) => Convert(await Deleting(args, model as T)); + public sealed override async Task> Deleting(InterceptorParameters args, MixtapeIdEntity model) => Convert(await Deleting(args, model as T)); /// public virtual Task Created(InterceptorParameters args, T model) => Task.CompletedTask; /// - public sealed override Task Created(InterceptorParameters args, FinchIdEntity model) => Created(args, model as T); + public sealed override Task Created(InterceptorParameters args, MixtapeIdEntity model) => Created(args, model as T); /// public virtual Task Updated(InterceptorParameters args, T model) => Task.CompletedTask; /// - public sealed override Task Updated(InterceptorParameters args, FinchIdEntity model) => Updated(args, model as T); + public sealed override Task Updated(InterceptorParameters args, MixtapeIdEntity model) => Updated(args, model as T); /// public virtual Task Deleted(InterceptorParameters args, T model) => Task.CompletedTask; /// - public sealed override Task Deleted(InterceptorParameters args, FinchIdEntity model) => Deleted(args, model as T); + public sealed override Task Deleted(InterceptorParameters args, MixtapeIdEntity model) => Deleted(args, model as T); - InterceptorResult Convert(InterceptorResult result) + InterceptorResult Convert(InterceptorResult result) { if (result == default) { return default; } - return new InterceptorResult() + return new InterceptorResult() { Continue = result.Continue, InterceptorHash = result.InterceptorHash, - Result = result.Result != null ? result.Result.ConvertTo(result.Result.Model) : null + Result = result.Result != null ? result.Result.ConvertTo(result.Result.Model) : null }; } } @@ -95,26 +95,26 @@ public abstract partial class Interceptor : IInterceptor public virtual bool CanHandle(InterceptorParameters args, Type modelType) => true; /// - public virtual Task> Creating(InterceptorParameters args, FinchIdEntity model) => Task.FromResult>(default); + public virtual Task> Creating(InterceptorParameters args, MixtapeIdEntity model) => Task.FromResult>(default); /// - public virtual Task> Updating(InterceptorParameters args, FinchIdEntity model) => Task.FromResult>(default); + public virtual Task> Updating(InterceptorParameters args, MixtapeIdEntity model) => Task.FromResult>(default); /// - public virtual Task> Deleting(InterceptorParameters args, FinchIdEntity model) => Task.FromResult>(default); + public virtual Task> Deleting(InterceptorParameters args, MixtapeIdEntity model) => Task.FromResult>(default); /// - public virtual Task Created(InterceptorParameters args, FinchIdEntity model) => Task.CompletedTask; + public virtual Task Created(InterceptorParameters args, MixtapeIdEntity model) => Task.CompletedTask; /// - public virtual Task Updated(InterceptorParameters args, FinchIdEntity model) => Task.CompletedTask; + public virtual Task Updated(InterceptorParameters args, MixtapeIdEntity model) => Task.CompletedTask; /// - public virtual Task Deleted(InterceptorParameters args, FinchIdEntity model) => Task.CompletedTask; + public virtual Task Deleted(InterceptorParameters args, MixtapeIdEntity model) => Task.CompletedTask; } -public interface IInterceptor : IInterceptor where T : FinchIdEntity +public interface IInterceptor : IInterceptor where T : MixtapeIdEntity { /// /// Type of the associated model @@ -178,30 +178,30 @@ public interface IInterceptor /// /// Called after an entity has been stored but before the session has saved its changes /// - Task Created(InterceptorParameters args, FinchIdEntity model); + Task Created(InterceptorParameters args, MixtapeIdEntity model); /// /// Called before an entity is stored and validated /// - Task> Creating(InterceptorParameters args, FinchIdEntity model); + Task> Creating(InterceptorParameters args, MixtapeIdEntity model); /// /// Called after an entity has been deleted but before the session has saved its changes /// - Task Deleted(InterceptorParameters args, FinchIdEntity model); + Task Deleted(InterceptorParameters args, MixtapeIdEntity model); /// /// Called before an entity is deleted /// - Task> Deleting(InterceptorParameters args, FinchIdEntity model); + Task> Deleting(InterceptorParameters args, MixtapeIdEntity model); /// /// Called after an entity has been updated but before the session has saved its changes /// - Task Updated(InterceptorParameters args, FinchIdEntity model); + Task Updated(InterceptorParameters args, MixtapeIdEntity model); /// /// Called before an entity is stored and validated /// - Task> Updating(InterceptorParameters args, FinchIdEntity model); + Task> Updating(InterceptorParameters args, MixtapeIdEntity model); } \ No newline at end of file diff --git a/Finch.Raven/Interceptors/InterceptorInstruction.cs b/mixtape.Raven/Interceptors/InterceptorInstruction.cs similarity index 85% rename from Finch.Raven/Interceptors/InterceptorInstruction.cs rename to mixtape.Raven/Interceptors/InterceptorInstruction.cs index 3970022b..502129fc 100644 --- a/Finch.Raven/Interceptors/InterceptorInstruction.cs +++ b/mixtape.Raven/Interceptors/InterceptorInstruction.cs @@ -1,8 +1,8 @@ using Microsoft.Extensions.Logging; -namespace Finch.Raven; +namespace Mixtape.Raven; -public class InterceptorInstruction where T : FinchIdEntity, new() +public class InterceptorInstruction where T : MixtapeIdEntity, new() { public Guid Guid { get; private set; } @@ -16,9 +16,9 @@ public class InterceptorInstruction where T : FinchIdEntity, new() public Result Result { get; private set; } - protected IFinchContext Context { get; } + protected IMixtapeContext Context { get; } - protected IFinchStore Store { get; } + protected IMixtapeStore Store { get; } protected Lazy> Interceptors { get; } @@ -31,7 +31,7 @@ public class InterceptorInstruction where T : FinchIdEntity, new() protected Func InterceptorFilter { get; private set; } = x => true; - internal InterceptorInstruction(IInterceptors interceptors, IFinchStore store, IFinchContext context, Lazy> registrations, ILogger logger, InterceptorRunType runtype, T model, T previousModel = null) + internal InterceptorInstruction(IInterceptors interceptors, IMixtapeStore store, IMixtapeContext context, Lazy> registrations, ILogger logger, InterceptorRunType runtype, T model, T previousModel = null) { InterceptorHandler = interceptors; Store = store; @@ -83,7 +83,7 @@ public class InterceptorInstruction where T : FinchIdEntity, new() Logger.LogDebug("Run interceptor {interceptor} for {type}:{operation}", interceptor.Name, ModelType, Runtype); - InterceptorResult result = (await HandleBefore(interceptor, parameters)) ?? new(); + InterceptorResult result = (await HandleBefore(interceptor, parameters)) ?? new(); result.InterceptorHash = IdGenerator.Create(32); InterceptorCache.Add(interceptor, parameters); @@ -129,7 +129,7 @@ public class InterceptorInstruction where T : FinchIdEntity, new() /// /// Proxy for handling methods on an interceptor /// - protected Task> HandleBefore(IInterceptor interceptor, InterceptorParameters parameters) => Runtype switch + protected Task> HandleBefore(IInterceptor interceptor, InterceptorParameters parameters) => Runtype switch { InterceptorRunType.Create => interceptor.Creating(parameters, Model), InterceptorRunType.Update => interceptor.Updating(parameters, Model), diff --git a/Finch.Raven/Interceptors/InterceptorParameters.cs b/mixtape.Raven/Interceptors/InterceptorParameters.cs similarity index 87% rename from Finch.Raven/Interceptors/InterceptorParameters.cs rename to mixtape.Raven/Interceptors/InterceptorParameters.cs index c1a32798..2643ef33 100644 --- a/Finch.Raven/Interceptors/InterceptorParameters.cs +++ b/mixtape.Raven/Interceptors/InterceptorParameters.cs @@ -1,16 +1,16 @@ -namespace Finch.Raven; +namespace Mixtape.Raven; public class InterceptorParameters { /// - /// The current finch context + /// The current mixtape context /// - public IFinchContext Context { get; set; } + public IMixtapeContext Context { get; set; } /// /// Raven document store /// - public IFinchStore Store { get; set; } + public IMixtapeStore Store { get; set; } /// /// Access to other interceptor methods diff --git a/Finch.Raven/Interceptors/InterceptorResult.cs b/mixtape.Raven/Interceptors/InterceptorResult.cs similarity index 95% rename from Finch.Raven/Interceptors/InterceptorResult.cs rename to mixtape.Raven/Interceptors/InterceptorResult.cs index 29c3441f..bcf7fdc8 100644 --- a/Finch.Raven/Interceptors/InterceptorResult.cs +++ b/mixtape.Raven/Interceptors/InterceptorResult.cs @@ -1,4 +1,4 @@ -namespace Finch.Raven; +namespace Mixtape.Raven; public class InterceptorResult { diff --git a/Finch.Raven/Interceptors/InterceptorRunType.cs b/mixtape.Raven/Interceptors/InterceptorRunType.cs similarity index 73% rename from Finch.Raven/Interceptors/InterceptorRunType.cs rename to mixtape.Raven/Interceptors/InterceptorRunType.cs index 16e214b7..84dc5b99 100644 --- a/Finch.Raven/Interceptors/InterceptorRunType.cs +++ b/mixtape.Raven/Interceptors/InterceptorRunType.cs @@ -1,4 +1,4 @@ -namespace Finch.Raven; +namespace Mixtape.Raven; public enum InterceptorRunType { diff --git a/Finch.Raven/Interceptors/Interceptors.cs b/mixtape.Raven/Interceptors/Interceptors.cs similarity index 54% rename from Finch.Raven/Interceptors/Interceptors.cs rename to mixtape.Raven/Interceptors/Interceptors.cs index 933954fe..238ef573 100644 --- a/Finch.Raven/Interceptors/Interceptors.cs +++ b/mixtape.Raven/Interceptors/Interceptors.cs @@ -1,19 +1,19 @@ using Microsoft.Extensions.Logging; -namespace Finch.Raven; +namespace Mixtape.Raven; public class Interceptors : IInterceptors { - protected IFinchContext Context { get; set; } + protected IMixtapeContext Context { get; set; } - protected IFinchStore Store { get; set; } + protected IMixtapeStore Store { get; set; } protected Lazy> Registrations { get; set; } protected ILogger Logger { get; set; } - public Interceptors(IFinchContext context, IFinchStore store, Lazy> registrations, ILogger logger) + public Interceptors(IMixtapeContext context, IMixtapeStore store, Lazy> registrations, ILogger logger) { Context = context; Store = store; @@ -23,13 +23,13 @@ public class Interceptors : IInterceptors /// - public InterceptorInstruction ForCreate(T model) where T : FinchIdEntity, new() => new(this, Store, Context, Registrations, Logger, InterceptorRunType.Create, model); + public InterceptorInstruction ForCreate(T model) where T : MixtapeIdEntity, new() => new(this, Store, Context, Registrations, Logger, InterceptorRunType.Create, model); /// - public InterceptorInstruction ForUpdate(T model, T previousModel = null) where T : FinchIdEntity, new() => new(this, Store, Context, Registrations, Logger, InterceptorRunType.Update, model, previousModel); + public InterceptorInstruction ForUpdate(T model, T previousModel = null) where T : MixtapeIdEntity, new() => new(this, Store, Context, Registrations, Logger, InterceptorRunType.Update, model, previousModel); /// - public InterceptorInstruction ForDelete(T model) where T : FinchIdEntity, new() => new(this, Store, Context, Registrations, Logger, InterceptorRunType.Delete, model); + public InterceptorInstruction ForDelete(T model) where T : MixtapeIdEntity, new() => new(this, Store, Context, Registrations, Logger, InterceptorRunType.Delete, model); } @@ -38,15 +38,15 @@ public interface IInterceptors /// /// Instruction which can run interceptors before and after a creating an entity /// - InterceptorInstruction ForCreate(T model) where T : FinchIdEntity, new(); + InterceptorInstruction ForCreate(T model) where T : MixtapeIdEntity, new(); /// /// Instruction which can run interceptors before and after updating an entity /// - InterceptorInstruction ForUpdate(T model, T previousModel = null) where T : FinchIdEntity, new(); + InterceptorInstruction ForUpdate(T model, T previousModel = null) where T : MixtapeIdEntity, new(); /// /// Instruction which can run interceptors before and after deleting an entity /// - InterceptorInstruction ForDelete(T model) where T : FinchIdEntity, new(); + InterceptorInstruction ForDelete(T model) where T : MixtapeIdEntity, new(); } \ No newline at end of file diff --git a/Finch.Raven/FinchRavenModule.cs b/mixtape.Raven/MixtapeRavenModule.cs similarity index 65% rename from Finch.Raven/FinchRavenModule.cs rename to mixtape.Raven/MixtapeRavenModule.cs index abb2e844..a2c804f2 100644 --- a/Finch.Raven/FinchRavenModule.cs +++ b/mixtape.Raven/MixtapeRavenModule.cs @@ -2,39 +2,39 @@ using Microsoft.Extensions.DependencyInjection; using Raven.Client.Documents.Indexes; using Raven.Client.Http; -using Finch.Identity; -using Finch.Media; -using Finch.Numbers; +using Mixtape.Identity; +using Mixtape.Media; +using Mixtape.Numbers; -namespace Finch.Raven; +namespace Mixtape.Raven; -public static class FinchBuilderExtensions +public static class MixtapeBuilderExtensions { - public static FinchBuilder AddRavenDb(this FinchBuilder builder) + public static MixtapeBuilder AddRavenDb(this MixtapeBuilder builder) { - builder.AddModule(); + builder.AddModule(); return builder; } } -internal class FinchRavenModule : FinchModule +internal class MixtapeRavenModule : MixtapeModule { public override void ConfigureServices(IServiceCollection services, IConfiguration configuration) { services.AddSingleton(); services.AddSingleton(CreateRavenStore); - services.AddScoped(); - services.AddScoped(); + services.AddScoped(); + services.AddScoped(); services.AddScoped(); services.AddTransient(); services.AddScoped(); - services.Replace(ServiceLifetime.Scoped); - services.Replace(ServiceLifetime.Scoped); - services.Replace(ServiceLifetime.Scoped); + services.Replace(ServiceLifetime.Scoped); + services.Replace(ServiceLifetime.Scoped); + services.Replace(ServiceLifetime.Scoped); services.AddOptions(); - services.AddOptions().Bind(configuration.GetSection("Finch:Raven")); + services.AddOptions().Bind(configuration.GetSection("Mixtape:Raven")); services.ConfigureOptions(); } @@ -43,7 +43,7 @@ internal class FinchRavenModule : FinchModule /// protected IDocumentStore CreateRavenStore(IServiceProvider services) { - IFinchOptions options = services.GetService(); + IMixtapeOptions options = services.GetService(); RavenOptions ravenOptions = options.For(); IRavenDocumentConventionsBuilder conventionsBuilder = services.GetService(); @@ -66,7 +66,7 @@ internal class FinchRavenModule : FinchModule IDocumentStore raven = store.Initialize(); // create all indexes - IEnumerable indexes = ravenOptions.Indexes.BuildAll(options, store); + IEnumerable indexes = ravenOptions.Indexes.BuildAll(options, store); IndexCreation.CreateIndexes(indexes, store, database: ravenOptions.Database); diff --git a/Finch.Raven/FinchStore.cs b/mixtape.Raven/MixtapeStore.cs similarity index 78% rename from Finch.Raven/FinchStore.cs rename to mixtape.Raven/MixtapeStore.cs index a1e7de1a..07cf3c8d 100644 --- a/Finch.Raven/FinchStore.cs +++ b/mixtape.Raven/MixtapeStore.cs @@ -1,15 +1,15 @@ -namespace Finch.Raven; +namespace Mixtape.Raven; -public class FinchStore : IFinchStore +public class MixtapeStore : IMixtapeStore { - public FinchStore(IDocumentStore raven, IFinchOptions options) : base() + public MixtapeStore(IDocumentStore raven, IMixtapeOptions options) : base() { Options = options; Raven = raven; //Database = null; } - protected IFinchOptions Options { get; set; } + protected IMixtapeOptions Options { get; set; } protected Dictionary ScopedSessions { get; set; } = new(); private const string NullDb = "__default__"; @@ -19,11 +19,11 @@ public class FinchStore : IFinchStore /// - public IAsyncDocumentSession Session(FinchSessionResolution resolution = FinchSessionResolution.Reuse, SessionOptions options = null) + public IAsyncDocumentSession Session(MixtapeSessionResolution resolution = MixtapeSessionResolution.Reuse, SessionOptions options = null) { options ??= new SessionOptions(); - if (resolution == FinchSessionResolution.Create) + if (resolution == MixtapeSessionResolution.Create) { return Raven.OpenAsyncSession(options); } @@ -69,14 +69,14 @@ public class FinchStore : IFinchStore } -public enum FinchSessionResolution +public enum MixtapeSessionResolution { Reuse = 0, Create = 1 } -public interface IFinchStore +public interface IMixtapeStore { /// /// Get underlying raven document store @@ -86,7 +86,7 @@ public interface IFinchStore /// /// Use a specific session /// - IAsyncDocumentSession Session(FinchSessionResolution resolution = FinchSessionResolution.Reuse, SessionOptions options = null); + IAsyncDocumentSession Session(MixtapeSessionResolution resolution = MixtapeSessionResolution.Reuse, SessionOptions options = null); /// /// Purges a collection diff --git a/Finch.Raven/Operations/RavenOperations.Delete.cs b/mixtape.Raven/Operations/RavenOperations.Delete.cs similarity index 87% rename from Finch.Raven/Operations/RavenOperations.Delete.cs rename to mixtape.Raven/Operations/RavenOperations.Delete.cs index fc736541..f3c073c8 100644 --- a/Finch.Raven/Operations/RavenOperations.Delete.cs +++ b/mixtape.Raven/Operations/RavenOperations.Delete.cs @@ -1,14 +1,14 @@ -namespace Finch.Raven; +namespace Mixtape.Raven; public partial class RavenOperations : IRavenOperations { /// - public virtual Task> Delete(T model) where T : FinchIdEntity, new() + public virtual Task> Delete(T model) where T : MixtapeIdEntity, new() => Delete(model.Id); /// - public virtual async Task> Delete(string id) where T : FinchIdEntity, new() + public virtual async Task> Delete(string id) where T : MixtapeIdEntity, new() { T model = await Load(id); @@ -45,7 +45,7 @@ public partial class RavenOperations : IRavenOperations /// - public virtual async Task Purge(string querySuffix = null, Parameters parameters = null) where T : FinchIdEntity, new() + public virtual async Task Purge(string querySuffix = null, Parameters parameters = null) where T : MixtapeIdEntity, new() { var collectionName = Store.Raven.Conventions.FindCollectionName(typeof(T)); var operationQuery = new DeleteByQueryOperation(new IndexQuery() diff --git a/Finch.Raven/Operations/RavenOperations.Empty.cs b/mixtape.Raven/Operations/RavenOperations.Empty.cs similarity index 68% rename from Finch.Raven/Operations/RavenOperations.Empty.cs rename to mixtape.Raven/Operations/RavenOperations.Empty.cs index 965dd651..b8320a11 100644 --- a/Finch.Raven/Operations/RavenOperations.Empty.cs +++ b/mixtape.Raven/Operations/RavenOperations.Empty.cs @@ -1,14 +1,14 @@ -namespace Finch.Raven; +namespace Mixtape.Raven; public partial class RavenOperations : IRavenOperations { /// - public virtual Task Empty(string flavorAlias = null) where T : FinchIdEntity, ISupportsFlavors, new() => Empty(flavorAlias); + public virtual Task Empty(string flavorAlias = null) where T : MixtapeIdEntity, ISupportsFlavors, new() => Empty(flavorAlias); /// public virtual Task Empty(string flavorAlias = null) - where T : FinchIdEntity, ISupportsFlavors, new() + where T : MixtapeIdEntity, ISupportsFlavors, new() where TFlavor : T, new() { return Task.FromResult(Flavors.Construct(flavorAlias)); diff --git a/Finch.Raven/Operations/RavenOperations.Read.cs b/mixtape.Raven/Operations/RavenOperations.Read.cs similarity index 85% rename from Finch.Raven/Operations/RavenOperations.Read.cs rename to mixtape.Raven/Operations/RavenOperations.Read.cs index c0e526a1..258ed14b 100644 --- a/Finch.Raven/Operations/RavenOperations.Read.cs +++ b/mixtape.Raven/Operations/RavenOperations.Read.cs @@ -2,12 +2,12 @@ using Raven.Client.Documents.Linq; using System.Linq.Expressions; -namespace Finch.Raven; +namespace Mixtape.Raven; public partial class RavenOperations : IRavenOperations { /// - public virtual async Task Load(string id, string changeVector = null) where T : FinchIdEntity, new() + public virtual async Task Load(string id, string changeVector = null) where T : MixtapeIdEntity, new() { if (id.IsNullOrWhiteSpace()) { @@ -23,7 +23,7 @@ public partial class RavenOperations : IRavenOperations /// - public virtual async Task> Load(IEnumerable ids) where T : FinchIdEntity, new() + public virtual async Task> Load(IEnumerable ids) where T : MixtapeIdEntity, new() { ids = ids.Distinct().ToArray(); @@ -41,7 +41,7 @@ public partial class RavenOperations : IRavenOperations /// - public virtual async Task> LoadAsList(IEnumerable ids) where T : FinchIdEntity, new() + public virtual async Task> LoadAsList(IEnumerable ids) where T : MixtapeIdEntity, new() { ids = ids.Distinct().ToArray(); @@ -62,7 +62,7 @@ public partial class RavenOperations : IRavenOperations /// - public virtual async Task Any(Func, IQueryable> querySelector = default) where T : FinchIdEntity, new() + public virtual async Task Any(Func, IQueryable> querySelector = default) where T : MixtapeIdEntity, new() { querySelector ??= x => x; return await querySelector(Session.Query()).AnyAsync(); @@ -70,7 +70,7 @@ public partial class RavenOperations : IRavenOperations /// - public virtual async Task> Load(int pageNumber, int pageSize, Func, IQueryable> querySelector = default) where T : FinchIdEntity, new() + public virtual async Task> Load(int pageNumber, int pageSize, Func, IQueryable> querySelector = default) where T : MixtapeIdEntity, new() { IRavenQueryable queryable = Session.Query().Statistics(out QueryStatistics statistics); querySelector ??= x => x; @@ -82,7 +82,7 @@ public partial class RavenOperations : IRavenOperations /// public virtual async Task> Load(int pageNumber, int pageSize, Func, IQueryable> querySelector = default) - where T : FinchIdEntity, new() + where T : MixtapeIdEntity, new() where TIndex : AbstractCommonApiForIndexes, new() { IRavenQueryable queryable = Session.Query().Statistics(out QueryStatistics statistics); @@ -94,7 +94,7 @@ public partial class RavenOperations : IRavenOperations /// - public virtual async Task> Load(Func, IQueryable> querySelector) where T : FinchIdEntity, new() + public virtual async Task> Load(Func, IQueryable> querySelector) where T : MixtapeIdEntity, new() { IRavenQueryable queryable = Session.Query(); querySelector ??= x => x; @@ -105,7 +105,7 @@ public partial class RavenOperations : IRavenOperations /// public virtual async Task> Load(Func, IQueryable> querySelector) - where T : FinchIdEntity, new() + where T : MixtapeIdEntity, new() where TIndex : AbstractCommonApiForIndexes, new() { IRavenQueryable queryable = Session.Query(); @@ -116,7 +116,7 @@ public partial class RavenOperations : IRavenOperations /// - public virtual async Task> Load(Expression> predicate) where T : FinchIdEntity, new() + public virtual async Task> Load(Expression> predicate) where T : MixtapeIdEntity, new() { return await Session.Query().Where(predicate).ToListAsync(); } @@ -124,7 +124,7 @@ public partial class RavenOperations : IRavenOperations /// public virtual async Task> Load(Expression> predicate) - where T : FinchIdEntity, new() + where T : MixtapeIdEntity, new() where TIndex : AbstractCommonApiForIndexes, new() { return await Session.Query().Where(predicate).ToListAsync(); @@ -133,8 +133,8 @@ public partial class RavenOperations : IRavenOperations /// public virtual async Task> Load(int pageNumber, int pageSize, Func, IQueryable> querySelector = default) - where T : FinchIdEntity, new() - where TProjection : FinchIdEntity, new() + where T : MixtapeIdEntity, new() + where TProjection : MixtapeIdEntity, new() where TIndex : AbstractCommonApiForIndexes, new() { IRavenQueryable queryable = Session.Query().Statistics(out QueryStatistics statistics); @@ -146,7 +146,7 @@ public partial class RavenOperations : IRavenOperations /// - public virtual async Task> LoadAll() where T : FinchIdEntity, new() + public virtual async Task> LoadAll() where T : MixtapeIdEntity, new() { List items = new(); @@ -160,7 +160,7 @@ public partial class RavenOperations : IRavenOperations /// - public virtual async IAsyncEnumerable Stream(Func, IQueryable> expression) where T : FinchIdEntity, new() + public virtual async IAsyncEnumerable Stream(Func, IQueryable> expression) where T : MixtapeIdEntity, new() { IRavenQueryable query = Session.Query(); IQueryable queryable = query; @@ -185,7 +185,7 @@ public partial class RavenOperations : IRavenOperations /// - public virtual string GetChangeToken(T model) where T : FinchIdEntity, new() + public virtual string GetChangeToken(T model) where T : MixtapeIdEntity, new() { string changeVector = Session.Advanced.GetChangeVectorFor(model); return IdGenerator.HashString(changeVector); diff --git a/Finch.Raven/Operations/RavenOperations.Tree.cs b/mixtape.Raven/Operations/RavenOperations.Tree.cs similarity index 78% rename from Finch.Raven/Operations/RavenOperations.Tree.cs rename to mixtape.Raven/Operations/RavenOperations.Tree.cs index d20a8897..2e86d9a2 100644 --- a/Finch.Raven/Operations/RavenOperations.Tree.cs +++ b/mixtape.Raven/Operations/RavenOperations.Tree.cs @@ -1,12 +1,12 @@ using Raven.Client.Documents.Indexes; using Raven.Client.Documents.Linq; -namespace Finch.Raven; +namespace Mixtape.Raven; public partial class RavenOperations : IRavenOperations { /// - public virtual Task IsAllowedAsChild(T model, string parentId) where T : FinchIdEntity, ISupportsTrees, new() + public virtual Task IsAllowedAsChild(T model, string parentId) where T : MixtapeIdEntity, ISupportsTrees, new() { return Task.FromResult(true); } @@ -14,13 +14,13 @@ public partial class RavenOperations : IRavenOperations /// public async Task GetHierarchy(string id) - where T : FinchIdEntity, ISupportsTrees, new() - where TIndex : FinchTreeHierarchyIndex, new() + where T : MixtapeIdEntity, ISupportsTrees, new() + where TIndex : MixtapeTreeHierarchyIndex, new() { - FinchTreeHierarchyIndexResult result = await Session.Query() - .ProjectInto() - .Include(x => x.Path) - .Include(x => x.Id) + MixtapeTreeHierarchyIndexResult result = await Session.Query() + .ProjectInto() + .Include(x => x.Path) + .Include(x => x.Id) .FirstOrDefaultAsync(x => x.Id == id); if (result == null) @@ -36,7 +36,7 @@ public partial class RavenOperations : IRavenOperations /// - public async Task> LoadChildren(string parentId, int pageNumber, int pageSize, Func, IQueryable> querySelector = default) where T : FinchIdEntity, ISupportsTrees, new() + public async Task> LoadChildren(string parentId, int pageNumber, int pageSize, Func, IQueryable> querySelector = default) where T : MixtapeIdEntity, ISupportsTrees, new() { IRavenQueryable queryable = Session.Query().Where(x => x.ParentId == parentId).Statistics(out QueryStatistics statistics); querySelector ??= x => x.OrderBy(x => x.Sort); @@ -48,7 +48,7 @@ public partial class RavenOperations : IRavenOperations /// public async Task> LoadChildren(string parentId, int pageNumber, int pageSize, Func, IQueryable> querySelector = default) - where T : FinchIdEntity, ISupportsTrees, new() + where T : MixtapeIdEntity, ISupportsTrees, new() where TIndex : AbstractCommonApiForIndexes, new() { IRavenQueryable queryable = Session.Query().Where(x => x.ParentId == parentId).Statistics(out QueryStatistics statistics); @@ -62,7 +62,7 @@ public partial class RavenOperations : IRavenOperations /// - public async Task> Move(string id, string newParentId, Func> isParentAllowed = null) where T : FinchIdEntity, ISupportsTrees, new() + public async Task> Move(string id, string newParentId, Func> isParentAllowed = null) where T : MixtapeIdEntity, ISupportsTrees, new() { T model = await Load(id); T parent = await Load(newParentId); @@ -84,17 +84,17 @@ public partial class RavenOperations : IRavenOperations /// - public Task> Copy(string id, string newParentId, Func> isParentAllowed = null) where T : FinchIdEntity, ISupportsTrees, new() => Copy(id, newParentId, false, isParentAllowed); + public Task> Copy(string id, string newParentId, Func> isParentAllowed = null) where T : MixtapeIdEntity, ISupportsTrees, new() => Copy(id, newParentId, false, isParentAllowed); /// - public Task> CopyWithDescendants(string id, string newParentId, Func> isParentAllowed = null) where T : FinchIdEntity, ISupportsTrees, new() => Copy(id, newParentId, true, isParentAllowed); + public Task> CopyWithDescendants(string id, string newParentId, Func> isParentAllowed = null) where T : MixtapeIdEntity, ISupportsTrees, new() => Copy(id, newParentId, true, isParentAllowed); /// /// Copies an entity (with optional descendants) to a new location /// - protected async Task> Copy(string id, string newParentId, bool includeDescendants, Func> isParentAllowed = null, bool isDescendant = false) where T : FinchIdEntity, ISupportsTrees, new() + protected async Task> Copy(string id, string newParentId, bool includeDescendants, Func> isParentAllowed = null, bool isDescendant = false) where T : MixtapeIdEntity, ISupportsTrees, new() { T originalModel = await Load(id); T model = ObjectCopycat.Clone(originalModel); @@ -112,11 +112,11 @@ public partial class RavenOperations : IRavenOperations model.Id = null; model.ParentId = parent?.Id; - if (model is FinchEntity finchEntity) + if (model is MixtapeEntity mixtapeEntity) { - finchEntity.IsActive = !isDescendant ? false : (originalModel as FinchEntity).IsActive; - finchEntity.CreatedDate = DateTime.Now; - finchEntity.Hash = null; + mixtapeEntity.IsActive = !isDescendant ? false : (originalModel as MixtapeEntity).IsActive; + mixtapeEntity.CreatedDate = DateTime.Now; + mixtapeEntity.Hash = null; } // check if new parent is allowed @@ -143,7 +143,7 @@ public partial class RavenOperations : IRavenOperations /// - public async Task> DeleteWithDescendants(T model) where T : FinchIdEntity, ISupportsTrees, new() + public async Task> DeleteWithDescendants(T model) where T : MixtapeIdEntity, ISupportsTrees, new() { List pages = await GetDescendantsAndSelf(model); @@ -160,7 +160,7 @@ public partial class RavenOperations : IRavenOperations /// /// Get an entity with all its descendants /// - async Task> GetDescendantsAndSelf(T model) where T : FinchIdEntity, ISupportsTrees, new() + async Task> GetDescendantsAndSelf(T model) where T : MixtapeIdEntity, ISupportsTrees, new() { List items = new() { model }; diff --git a/Finch.Raven/Operations/RavenOperations.Write.cs b/mixtape.Raven/Operations/RavenOperations.Write.cs similarity index 90% rename from Finch.Raven/Operations/RavenOperations.Write.cs rename to mixtape.Raven/Operations/RavenOperations.Write.cs index 2d9bca8d..440a926b 100644 --- a/Finch.Raven/Operations/RavenOperations.Write.cs +++ b/mixtape.Raven/Operations/RavenOperations.Write.cs @@ -1,18 +1,18 @@ using FluentValidation.Results; using Rv = Raven.Client; -namespace Finch.Raven; +namespace Mixtape.Raven; public partial class RavenOperations : IRavenOperations { /// - public virtual Task> Create(T model, Func> validate = null, Action onAfterStore = null) where T : FinchIdEntity, new() => Save(model, validate, onAfterStore); + public virtual Task> Create(T model, Func> validate = null, Action onAfterStore = null) where T : MixtapeIdEntity, new() => Save(model, validate, onAfterStore); /// - public virtual Task> Update(T model, Func> validate = null, Action onAfterStore = null) where T : FinchIdEntity, new() => Save(model, validate, onAfterStore, true); + public virtual Task> Update(T model, Func> validate = null, Action onAfterStore = null) where T : MixtapeIdEntity, new() => Save(model, validate, onAfterStore, true); /// - protected virtual async Task> Save(T model, Func> validate = null, Action onAfterStore = null, bool update = false) where T : FinchIdEntity, new() + protected virtual async Task> Save(T model, Func> validate = null, Action onAfterStore = null, bool update = false) where T : MixtapeIdEntity, new() { if (model == null) { @@ -91,7 +91,7 @@ public partial class RavenOperations : IRavenOperations /// - public async Task>> Sort(string[] sortedIds) where T : FinchIdEntity, ISupportsSorting, new() + public async Task>> Sort(string[] sortedIds) where T : MixtapeIdEntity, ISupportsSorting, new() { Dictionary items = await Load(sortedIds); uint index = 10; @@ -114,7 +114,7 @@ public partial class RavenOperations : IRavenOperations /// - public virtual async Task>> CreateAll(IEnumerable models) where T : FinchIdEntity, new() + public virtual async Task>> CreateAll(IEnumerable models) where T : MixtapeIdEntity, new() { using var bulkInsert = Store.Raven.BulkInsert(); diff --git a/Finch.Raven/Operations/RavenOperations.cs b/mixtape.Raven/Operations/RavenOperations.cs similarity index 69% rename from Finch.Raven/Operations/RavenOperations.cs rename to mixtape.Raven/Operations/RavenOperations.cs index fd578b19..86700fc8 100644 --- a/Finch.Raven/Operations/RavenOperations.cs +++ b/mixtape.Raven/Operations/RavenOperations.cs @@ -4,7 +4,7 @@ using Raven.Client.Documents.Indexes; using Raven.Client.Documents.Linq; using System.Linq.Expressions; -namespace Finch.Raven; +namespace Mixtape.Raven; public partial class RavenOperations : IRavenOperations { @@ -13,7 +13,7 @@ public partial class RavenOperations : IRavenOperations protected record OperationOptions(bool IncludeInactive); - protected IFinchContext Context { get; private set; } + protected IMixtapeContext Context { get; private set; } protected IInterceptors Interceptors { get; } @@ -21,7 +21,7 @@ public partial class RavenOperations : IRavenOperations protected IServiceProvider Services { get; } - protected IFinchStore Store { get; } + protected IMixtapeStore Store { get; } protected StoreInterceptorBlocker InterceptorBlocker { get; private set; } @@ -37,7 +37,7 @@ public partial class RavenOperations : IRavenOperations /// - public async Task GenerateId(T model) where T : FinchIdEntity + public async Task GenerateId(T model) where T : MixtapeIdEntity { IAsyncDocumentSession session = Session; return await session.Advanced.DocumentStore.Conventions.GenerateDocumentIdAsync(session.Advanced.DocumentStore.Database, model); @@ -52,33 +52,33 @@ public partial class RavenOperations : IRavenOperations /// - public T PrepareForSave(T model) where T : FinchIdEntity + public T PrepareForSave(T model) where T : MixtapeIdEntity { // set IDs AutoSetIds(model); - if (model is FinchEntity finchModel) + if (model is MixtapeEntity mixtapeModel) { // get current user string userId = null; //string userId = Context.BackofficeUser.FindFirstValue(Constants.Auth.Claims.UserId).Or(Constants.Auth.SystemUser); // set default properties - if (finchModel.CreatedDate == default) + if (mixtapeModel.CreatedDate == default) { - finchModel.CreatedDate = DateTimeOffset.Now; + mixtapeModel.CreatedDate = DateTimeOffset.Now; } - if (finchModel.CreatedById.IsNullOrEmpty()) + if (mixtapeModel.CreatedById.IsNullOrEmpty()) { - finchModel.CreatedById = userId; + mixtapeModel.CreatedById = userId; } // update name alias and last modified - finchModel.Alias = Safenames.Alias(finchModel.Name); - finchModel.LastModifiedById = userId; - finchModel.LastModifiedDate = DateTimeOffset.Now; - finchModel.CreatedById ??= userId; - finchModel.Hash ??= IdGenerator.Create(); + mixtapeModel.Alias = Safenames.Alias(mixtapeModel.Name); + mixtapeModel.LastModifiedById = userId; + mixtapeModel.LastModifiedDate = DateTimeOffset.Now; + mixtapeModel.CreatedById ??= userId; + mixtapeModel.Hash ??= IdGenerator.Create(); } return model; @@ -86,9 +86,9 @@ public partial class RavenOperations : IRavenOperations /// - public async Task Validate(T model) where T : FinchIdEntity, new() + public async Task Validate(T model) where T : MixtapeIdEntity, new() { - IFinchMergedValidator validator = Services.GetService>(); + IMixtapeMergedValidator validator = Services.GetService>(); if (validator == null) { @@ -107,10 +107,10 @@ public partial class RavenOperations : IRavenOperations /// - public virtual T WhenActive(T model) where T : FinchIdEntity, new() + public virtual T WhenActive(T model) where T : MixtapeIdEntity, new() { return model; // TODO should we really use this? I tried to get data in a custom backend but couldn't because of this - //return model != null && (model is not FinchEntity || (model as FinchEntity).IsActive) && (model is not ISupportsSoftDelete || !(model as ISupportsSoftDelete).IsDeleted) ? model : default; + //return model != null && (model is not MixtapeEntity || (model as MixtapeEntity).IsActive) && (model is not ISupportsSoftDelete || !(model as ISupportsSoftDelete).IsDeleted) ? model : default; } } @@ -141,20 +141,20 @@ public interface IRavenOperations /// /// Get new instance of an entity (with an optional flavor) /// - Task Empty(string flavorAlias = null) where T : FinchIdEntity, ISupportsFlavors, new(); + Task Empty(string flavorAlias = null) where T : MixtapeIdEntity, ISupportsFlavors, new(); /// /// Get new instance of an entity with a specific flavor /// /// Optional alias. If left out the default flavor is used (if configured) Task Empty(string flavorAlias = null) - where T : FinchIdEntity, ISupportsFlavors, new() + where T : MixtapeIdEntity, ISupportsFlavors, new() where TFlavor : T, new(); /// /// Generate model Id by using configured document store conventions /// - Task GenerateId(T model) where T : FinchIdEntity; + Task GenerateId(T model) where T : MixtapeIdEntity; /// /// Generate values for all properties (incl. nested) which contain the [GenerateId] attribute @@ -162,88 +162,88 @@ public interface IRavenOperations T AutoSetIds(T model); /// - /// Automatically fill base properties of a FinchEntity + /// Automatically fill base properties of a MixtapeEntity /// - T PrepareForSave(T model) where T : FinchIdEntity; + T PrepareForSave(T model) where T : MixtapeIdEntity; /// /// Check if any items exist in this collection (with optional query) /// - Task Any(Func, IQueryable> querySelector = default) where T : FinchIdEntity, new(); + Task Any(Func, IQueryable> querySelector = default) where T : MixtapeIdEntity, new(); /// /// Get an entity by Id /// - Task Load(string id, string changeVector = null) where T : FinchIdEntity, new(); + Task Load(string id, string changeVector = null) where T : MixtapeIdEntity, new(); /// /// Get entities by ids /// - Task> Load(IEnumerable ids) where T : FinchIdEntity, new(); + Task> Load(IEnumerable ids) where T : MixtapeIdEntity, new(); /// /// Get entities by ids /// - Task> LoadAsList(IEnumerable ids) where T : FinchIdEntity, new(); + Task> LoadAsList(IEnumerable ids) where T : MixtapeIdEntity, new(); /// /// Get entities by query /// - Task> Load(int pageNumber, int pageSize, Func, IQueryable> expression = default) where T : FinchIdEntity, new(); + Task> Load(int pageNumber, int pageSize, Func, IQueryable> expression = default) where T : MixtapeIdEntity, new(); /// /// Get entities by query (by using the specified index) /// - Task> Load(int pageNumber, int pageSize, Func, IQueryable> expression = default) where T : FinchIdEntity, new() where TIndex : AbstractCommonApiForIndexes, new(); + Task> Load(int pageNumber, int pageSize, Func, IQueryable> expression = default) where T : MixtapeIdEntity, new() where TIndex : AbstractCommonApiForIndexes, new(); /// /// Get entities by query /// - Task> Load(Func, IQueryable> expression) where T : FinchIdEntity, new(); + Task> Load(Func, IQueryable> expression) where T : MixtapeIdEntity, new(); /// /// Get entities by query (by using the specified index) /// - Task> Load(Func, IQueryable> expression) where T : FinchIdEntity, new() where TIndex : AbstractCommonApiForIndexes, new(); + Task> Load(Func, IQueryable> expression) where T : MixtapeIdEntity, new() where TIndex : AbstractCommonApiForIndexes, new(); /// /// Get entities by query /// - Task> Load(Expression> predicate) where T : FinchIdEntity, new(); + Task> Load(Expression> predicate) where T : MixtapeIdEntity, new(); /// /// Get entities by query (by using the specified index) /// - Task> Load(Expression> predicate) where T : FinchIdEntity, new() where TIndex : AbstractCommonApiForIndexes, new(); + Task> Load(Expression> predicate) where T : MixtapeIdEntity, new() where TIndex : AbstractCommonApiForIndexes, new(); /// /// Get entities by query (by using the specified index) and project into a result /// Task> Load(int pageNumber, int pageSize, Func, IQueryable> querySelector = default) - where T : FinchIdEntity, new() - where TProjection : FinchIdEntity, new() + where T : MixtapeIdEntity, new() + where TProjection : MixtapeIdEntity, new() where TIndex : AbstractCommonApiForIndexes, new(); /// /// Get all entities from this collection. /// Warning: Don't use this method for large collections. Stream the results instead. /// - Task> LoadAll() where T : FinchIdEntity, new(); + Task> LoadAll() where T : MixtapeIdEntity, new(); /// /// Stream the collection /// - IAsyncEnumerable Stream(Func, IQueryable> expression) where T : FinchIdEntity, new(); + IAsyncEnumerable Stream(Func, IQueryable> expression) where T : MixtapeIdEntity, new(); /// /// Get the change vector for a model /// - string GetChangeToken(T model) where T : FinchIdEntity, new(); + string GetChangeToken(T model) where T : MixtapeIdEntity, new(); /// /// Validates an entity /// - Task Validate(T model) where T : FinchIdEntity, new(); + Task Validate(T model) where T : MixtapeIdEntity, new(); /// /// Do not run interceptors for create/update/delete operations while this disposable is active @@ -253,73 +253,73 @@ public interface IRavenOperations /// /// Do only return the model when it is set to active or inactive entities are included with IncludeInactive() /// - T WhenActive(T model) where T : FinchIdEntity, new(); + T WhenActive(T model) where T : MixtapeIdEntity, new(); /// /// Creates an entity with an optional validator /// - Task> Create(T model, Func> validate = null, Action onAfterStore = null) where T : FinchIdEntity, new(); + Task> Create(T model, Func> validate = null, Action onAfterStore = null) where T : MixtapeIdEntity, new(); /// /// Updates an entity with an optional validator /// - Task> Update(T model, Func> validate = null, Action onAfterStore = null) where T : FinchIdEntity, new(); + Task> Update(T model, Func> validate = null, Action onAfterStore = null) where T : MixtapeIdEntity, new(); /// - Task>> Sort(string[] sortedIds) where T : FinchIdEntity, ISupportsSorting, new(); + Task>> Sort(string[] sortedIds) where T : MixtapeIdEntity, ISupportsSorting, new(); /// /// Batch create entities /// - Task>> CreateAll(IEnumerable models) where T : FinchIdEntity, new(); + Task>> CreateAll(IEnumerable models) where T : MixtapeIdEntity, new(); /// /// Deletes an entity /// - Task> Delete(T model) where T : FinchIdEntity, new(); + Task> Delete(T model) where T : MixtapeIdEntity, new(); /// /// Deletes an entity /// - Task> Delete(string id) where T : FinchIdEntity, new(); + Task> Delete(string id) where T : MixtapeIdEntity, new(); /// /// Deletes the whole collection /// - Task Purge(string querySuffix = null, Parameters parameters = null) where T : FinchIdEntity, new(); + Task Purge(string querySuffix = null, Parameters parameters = null) where T : MixtapeIdEntity, new(); /// /// Loads all children for an entity /// - Task> LoadChildren(string parentId, int pageNumber, int pageSize, Func, IQueryable> querySelector = default) where T : FinchIdEntity, ISupportsTrees, new(); + Task> LoadChildren(string parentId, int pageNumber, int pageSize, Func, IQueryable> querySelector = default) where T : MixtapeIdEntity, ISupportsTrees, new(); /// /// Get descendants by query (by using the specified index) /// - Task> LoadChildren(string parentId, int pageNumber, int pageSize, Func, IQueryable> querySelector = default) where T : FinchIdEntity, ISupportsTrees, new() where TIndex : AbstractCommonApiForIndexes, new(); + Task> LoadChildren(string parentId, int pageNumber, int pageSize, Func, IQueryable> querySelector = default) where T : MixtapeIdEntity, ISupportsTrees, new() where TIndex : AbstractCommonApiForIndexes, new(); /// /// Get tree hierarchy for an entity /// - Task GetHierarchy(string id) where T : FinchIdEntity, ISupportsTrees, new() where TIndex : FinchTreeHierarchyIndex, new(); + Task GetHierarchy(string id) where T : MixtapeIdEntity, ISupportsTrees, new() where TIndex : MixtapeTreeHierarchyIndex, new(); /// /// Move an entity to a new parent /// - Task> Move(string id, string newParentId, Func> isParentAllowed = null) where T : FinchIdEntity, ISupportsTrees, new(); + Task> Move(string id, string newParentId, Func> isParentAllowed = null) where T : MixtapeIdEntity, ISupportsTrees, new(); /// /// Copies an entity to a new location /// - Task> Copy(string id, string newParentId, Func> isParentAllowed = null) where T : FinchIdEntity, ISupportsTrees, new(); + Task> Copy(string id, string newParentId, Func> isParentAllowed = null) where T : MixtapeIdEntity, ISupportsTrees, new(); /// /// Copies an entity with descendants to a new location /// - Task> CopyWithDescendants(string id, string newParentId, Func> isParentAllowed = null) where T : FinchIdEntity, ISupportsTrees, new(); + Task> CopyWithDescendants(string id, string newParentId, Func> isParentAllowed = null) where T : MixtapeIdEntity, ISupportsTrees, new(); /// /// Deletes an entity with all descendents /// - Task> DeleteWithDescendants(T model) where T : FinchIdEntity, ISupportsTrees, new(); + Task> DeleteWithDescendants(T model) where T : MixtapeIdEntity, ISupportsTrees, new(); } \ No newline at end of file diff --git a/Finch.Raven/Operations/RavenOperationsExtensions.cs b/mixtape.Raven/Operations/RavenOperationsExtensions.cs similarity index 61% rename from Finch.Raven/Operations/RavenOperationsExtensions.cs rename to mixtape.Raven/Operations/RavenOperationsExtensions.cs index cfeb64a6..8424a58b 100644 --- a/Finch.Raven/Operations/RavenOperationsExtensions.cs +++ b/mixtape.Raven/Operations/RavenOperationsExtensions.cs @@ -1,35 +1,35 @@ using System.Linq.Expressions; -namespace Finch.Raven; +namespace Mixtape.Raven; public static class RavenOperationsExtensions { /// /// Stream the collection /// - public static IAsyncEnumerable Stream(this IRavenOperations ops) where T : FinchIdEntity, new() => ops.Stream(null); + public static IAsyncEnumerable Stream(this IRavenOperations ops) where T : MixtapeIdEntity, new() => ops.Stream(null); /// /// Deletes an entity by Id /// - public static async Task> Delete(this IRavenOperations ops, string id) where T : FinchIdEntity, new() => await ops.Delete(await ops.Load(id)); + public static async Task> Delete(this IRavenOperations ops, string id) where T : MixtapeIdEntity, new() => await ops.Delete(await ops.Load(id)); /// /// Deletes entities by selector /// - public static async Task Delete(this IRavenOperations ops, Expression> predicate) where T : FinchIdEntity, new() => await ops.Delete(await ops.Load(predicate)); + public static async Task Delete(this IRavenOperations ops, Expression> predicate) where T : MixtapeIdEntity, new() => await ops.Delete(await ops.Load(predicate)); /// /// Deletes entities by Id /// - public static async Task Delete(this IRavenOperations ops, IEnumerable ids) where T : FinchIdEntity, new() => await ops.Delete((await ops.Load(ids)).Select(x => x.Value)); + public static async Task Delete(this IRavenOperations ops, IEnumerable ids) where T : MixtapeIdEntity, new() => await ops.Delete((await ops.Load(ids)).Select(x => x.Value)); /// /// Deletes entities /// - public static async Task Delete(this IRavenOperations ops, IEnumerable models) where T : FinchIdEntity, new() + public static async Task Delete(this IRavenOperations ops, IEnumerable models) where T : MixtapeIdEntity, new() { int successCount = 0; @@ -45,5 +45,5 @@ public static class RavenOperationsExtensions /// /// Deletes an entity by Id with all descendents /// - public static async Task> DeleteWithDescendants(this IRavenOperations ops, string id) where T : FinchIdEntity, ISupportsTrees, new() => await ops.DeleteWithDescendants(await ops.Load(id)); + public static async Task> DeleteWithDescendants(this IRavenOperations ops, string id) where T : MixtapeIdEntity, ISupportsTrees, new() => await ops.DeleteWithDescendants(await ops.Load(id)); } \ No newline at end of file diff --git a/Finch.Raven/Operations/StoreContext.cs b/mixtape.Raven/Operations/StoreContext.cs similarity index 52% rename from Finch.Raven/Operations/StoreContext.cs rename to mixtape.Raven/Operations/StoreContext.cs index 7c4e7156..b0fae4a8 100644 --- a/Finch.Raven/Operations/StoreContext.cs +++ b/mixtape.Raven/Operations/StoreContext.cs @@ -1,12 +1,12 @@ -namespace Finch.Raven; +namespace Mixtape.Raven; public class StoreContext { - public IFinchStore Store { get; private set; } + public IMixtapeStore Store { get; private set; } - public IFinchContext Context { get; private set; } + public IMixtapeContext Context { get; private set; } - public IFinchOptions Options { get; private set; } + public IMixtapeOptions Options { get; private set; } public IInterceptors Interceptors { get; private set; } @@ -15,7 +15,7 @@ public class StoreContext public IMessageAggregator Messages { get; private set; } - public StoreContext(IFinchContext context, IFinchStore store, IInterceptors interceptors, IServiceProvider serviceProvider, IMessageAggregator messages) + public StoreContext(IMixtapeContext context, IMixtapeStore store, IInterceptors interceptors, IServiceProvider serviceProvider, IMessageAggregator messages) { Store = store; Options = context.Options; diff --git a/Finch.Raven/RavenCollectionAttribute.cs b/mixtape.Raven/RavenCollectionAttribute.cs similarity index 93% rename from Finch.Raven/RavenCollectionAttribute.cs rename to mixtape.Raven/RavenCollectionAttribute.cs index 06326197..b8d0671a 100644 --- a/Finch.Raven/RavenCollectionAttribute.cs +++ b/mixtape.Raven/RavenCollectionAttribute.cs @@ -1,4 +1,4 @@ -namespace Finch.Raven; +namespace Mixtape.Raven; /// /// This attribute will allow the usage of custom collection names for Raven collections diff --git a/Finch.Raven/RavenConstants.cs b/mixtape.Raven/RavenConstants.cs similarity index 86% rename from Finch.Raven/RavenConstants.cs rename to mixtape.Raven/RavenConstants.cs index d0e4a33d..60347af7 100644 --- a/Finch.Raven/RavenConstants.cs +++ b/mixtape.Raven/RavenConstants.cs @@ -1,4 +1,4 @@ -namespace Finch.Raven; +namespace Mixtape.Raven; public static partial class RavenConstants { diff --git a/Finch.Raven/RavenDocumentConventionsBuilder.cs b/mixtape.Raven/RavenDocumentConventionsBuilder.cs similarity index 88% rename from Finch.Raven/RavenDocumentConventionsBuilder.cs rename to mixtape.Raven/RavenDocumentConventionsBuilder.cs index 5b8f86e3..32afe721 100644 --- a/Finch.Raven/RavenDocumentConventionsBuilder.cs +++ b/mixtape.Raven/RavenDocumentConventionsBuilder.cs @@ -4,22 +4,22 @@ using System.Reflection; using System.Text; using Rv = Raven.Client; -namespace Finch.Raven; +namespace Mixtape.Raven; public class RavenDocumentConventionsBuilder : IRavenDocumentConventionsBuilder { protected HashSet PolymorphTypes { get; } = new(); - protected Type AcceptsFinchConventionsType { get; set; } = typeof(ISupportsDbConventions); + protected Type AcceptsMixtapeConventionsType { get; set; } = typeof(ISupportsDbConventions); protected char IdentityPartsSeparator { get; set; } = '.'; - protected IFinchOptions Options { get; } + protected IMixtapeOptions Options { get; } protected static ConcurrentDictionary CachedTypeCollectionNameMap = new(); - public RavenDocumentConventionsBuilder(IFinchOptions options) + public RavenDocumentConventionsBuilder(IMixtapeOptions options) { Options = options; } @@ -32,7 +32,7 @@ public class RavenDocumentConventionsBuilder : IRavenDocumentConventionsBuilder conventions.IdentityPartsSeparator = IdentityPartsSeparator; conventions.TransformTypeCollectionNameToDocumentIdPrefix = TransformTypeCollectionNameToDocumentIdPrefix; conventions.FindCollectionName = FindCollectionName; - conventions.RegisterAsyncIdConvention((_, entity) => GetDocumentId(conventions, entity)); + conventions.RegisterAsyncIdConvention((_, entity) => GetDocumentId(conventions, entity)); } @@ -80,7 +80,7 @@ public class RavenDocumentConventionsBuilder : IRavenDocumentConventionsBuilder } // do not alter non-internal entities - if (!AcceptsFinchConventionsType.IsAssignableFrom(type)) + if (!AcceptsMixtapeConventionsType.IsAssignableFrom(type)) { return cache(DocumentConventions.DefaultGetCollectionName(type)); } @@ -94,7 +94,7 @@ public class RavenDocumentConventionsBuilder : IRavenDocumentConventionsBuilder } // use base interface if available - Type interfaceBaseType = type.GetInterfaces().FirstOrDefault(x => x.IsInterface && AcceptsFinchConventionsType.IsAssignableFrom(x) && x.Name != AcceptsFinchConventionsType.Name); + Type interfaceBaseType = type.GetInterfaces().FirstOrDefault(x => x.IsInterface && AcceptsMixtapeConventionsType.IsAssignableFrom(x) && x.Name != AcceptsMixtapeConventionsType.Name); if (interfaceBaseType != null) { diff --git a/Finch.Raven/RavenOptions.cs b/mixtape.Raven/RavenOptions.cs similarity index 65% rename from Finch.Raven/RavenOptions.cs rename to mixtape.Raven/RavenOptions.cs index 8c3996e2..7b4555c3 100644 --- a/Finch.Raven/RavenOptions.cs +++ b/mixtape.Raven/RavenOptions.cs @@ -1,6 +1,6 @@ using System.Linq.Expressions; -namespace Finch.Raven; +namespace Mixtape.Raven; public class RavenOptions { @@ -22,9 +22,9 @@ public class RavenIndexesOptions : List { internal Type Type { get; set; } - internal Expression> CreateIndex { get; set; } + internal Expression> CreateIndex { get; set; } - internal Map(Type type, Expression> create) + internal Map(Type type, Expression> create) { Type = type; CreateIndex = create; @@ -34,17 +34,17 @@ public class RavenIndexesOptions : List public RavenIndexModifiersOptions Modifiers { get; private set; } = new(); - public void Add() where T : IFinchIndexDefinition, new() + public void Add() where T : IMixtapeIndexDefinition, new() { base.Add(new Map(typeof(T), () => new T())); } public void Add(Type indexType) { - base.Add(new Map(indexType, () => (IFinchIndexDefinition)Activator.CreateInstance(indexType))); + base.Add(new Map(indexType, () => (IMixtapeIndexDefinition)Activator.CreateInstance(indexType))); } - public void Add(T index) where T : IFinchIndexDefinition + public void Add(T index) where T : IMixtapeIndexDefinition { base.Add(new Map(typeof(T), () => index)); } @@ -58,8 +58,8 @@ public class RavenIndexesOptions : List } public void Replace() - where T : IFinchIndexDefinition, new() - where TReplaceWith : IFinchIndexDefinition, new() + where T : IMixtapeIndexDefinition, new() + where TReplaceWith : IMixtapeIndexDefinition, new() { Replace(typeof(T), typeof(TReplaceWith)); } @@ -74,13 +74,13 @@ public class RavenIndexesOptions : List Add(replaceWith); } - public IEnumerable BuildAll(IFinchOptions options, IDocumentStore store) + public IEnumerable BuildAll(IMixtapeOptions options, IDocumentStore store) { RavenOptions ravenOptions = options.For(); foreach (Map map in this) { - IFinchIndexDefinition index = map.CreateIndex.Compile().Invoke(); + IMixtapeIndexDefinition index = map.CreateIndex.Compile().Invoke(); index.Setup(options, store); index.RunModifiers(ravenOptions); yield return index; @@ -95,10 +95,10 @@ public class RavenIndexModifiersOptions : List> Modify { get; set; } + public Expression> Modify { get; set; } } - public void Add(Action modify) where T : IFinchIndexDefinition, new() + public void Add(Action modify) where T : IMixtapeIndexDefinition, new() { Add(new() { @@ -108,7 +108,7 @@ public class RavenIndexModifiersOptions : List GetAllForType() where T : IFinchIndexDefinition, new() => GetAllForType(typeof(T)); + public IEnumerable GetAllForType() where T : IMixtapeIndexDefinition, new() => GetAllForType(typeof(T)); public IEnumerable GetAllForType(Type type) diff --git a/Finch.Raven/Tokens/FinchTokenProvider.cs b/mixtape.Raven/Tokens/MixtapeTokenProvider.cs similarity index 97% rename from Finch.Raven/Tokens/FinchTokenProvider.cs rename to mixtape.Raven/Tokens/MixtapeTokenProvider.cs index 8421b5d2..d9898f96 100644 --- a/Finch.Raven/Tokens/FinchTokenProvider.cs +++ b/mixtape.Raven/Tokens/MixtapeTokenProvider.cs @@ -2,18 +2,18 @@ using System.Security.Cryptography; using System.Text; -namespace Finch.Raven; +namespace Mixtape.Raven; -public class FinchTokenProvider : IFinchTokenProvider +public class MixtapeTokenProvider : IMixtapeTokenProvider { readonly char[] chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-".ToCharArray(); readonly RandomNumberGenerator randonNumberGenerator; - protected IFinchStore Store { get; } + protected IMixtapeStore Store { get; } - public FinchTokenProvider(IFinchStore store) + public MixtapeTokenProvider(IMixtapeStore store) { Store = store; randonNumberGenerator = RandomNumberGenerator.Create(); @@ -245,7 +245,7 @@ public class FinchTokenProvider : IFinchTokenProvider } -public interface IFinchTokenProvider +public interface IMixtapeTokenProvider { /// /// Generates a token for a with a specified lifespan. diff --git a/Finch.Raven/Tokens/Rfc6238AuthenticationService.cs b/mixtape.Raven/Tokens/Rfc6238AuthenticationService.cs similarity index 99% rename from Finch.Raven/Tokens/Rfc6238AuthenticationService.cs rename to mixtape.Raven/Tokens/Rfc6238AuthenticationService.cs index 23619b90..e0cb0bcf 100644 --- a/Finch.Raven/Tokens/Rfc6238AuthenticationService.cs +++ b/mixtape.Raven/Tokens/Rfc6238AuthenticationService.cs @@ -3,7 +3,7 @@ using System.Net; using System.Security.Cryptography; using System.Text; -namespace Finch.Raven; +namespace Mixtape.Raven; /// /// Replicates the Rfc6238AuthenticationService from ASP.NET Core internals as it isn't part of the public API diff --git a/Finch.Raven/Tokens/Token.cs b/mixtape.Raven/Tokens/Token.cs similarity index 90% rename from Finch.Raven/Tokens/Token.cs rename to mixtape.Raven/Tokens/Token.cs index 8a809751..ac113b81 100644 --- a/Finch.Raven/Tokens/Token.cs +++ b/mixtape.Raven/Tokens/Token.cs @@ -1,4 +1,4 @@ -namespace Finch.Raven; +namespace Mixtape.Raven; [RavenCollection("Tokens")] public class SecurityToken : ISupportsDbConventions diff --git a/Finch.Raven/Usings.cs b/mixtape.Raven/Usings.cs similarity index 52% rename from Finch.Raven/Usings.cs rename to mixtape.Raven/Usings.cs index a39c98d9..c1626fdc 100644 --- a/Finch.Raven/Usings.cs +++ b/mixtape.Raven/Usings.cs @@ -6,17 +6,17 @@ global using System.Linq; global using System.Threading; global using System.Threading.Tasks; -global using Finch.Utils; -global using Finch.Configuration; -global using Finch.Extensions; -global using Finch.FileStorage; -global using Finch.Models; -global using Finch.Modules; -global using Finch.Rendering; -global using Finch.Validation; -global using Finch.Localization; -global using Finch.Context; -global using Finch.Communication; +global using Mixtape.Utils; +global using Mixtape.Configuration; +global using Mixtape.Extensions; +global using Mixtape.FileStorage; +global using Mixtape.Models; +global using Mixtape.Modules; +global using Mixtape.Rendering; +global using Mixtape.Validation; +global using Mixtape.Localization; +global using Mixtape.Context; +global using Mixtape.Communication; global using Raven.Client.Documents; global using Raven.Client.Documents.Operations; diff --git a/Finch.Raven/Finch.Raven.csproj b/mixtape.Raven/mixtape.Raven.csproj similarity index 80% rename from Finch.Raven/Finch.Raven.csproj rename to mixtape.Raven/mixtape.Raven.csproj index e6680d3f..6df86131 100644 --- a/Finch.Raven/Finch.Raven.csproj +++ b/mixtape.Raven/mixtape.Raven.csproj @@ -1,11 +1,11 @@ - Finch.Raven + Mixtape.Raven 1.0.0 net8.0;net9.0;net10.0 true - Finch.Raven + Mixtape.Raven embedded @@ -17,7 +17,7 @@ - + \ No newline at end of file diff --git a/Finch.Sqlite/Extensions/SqlExpressionExtensions.cs b/mixtape.Sqlite/Extensions/SqlExpressionExtensions.cs similarity index 94% rename from Finch.Sqlite/Extensions/SqlExpressionExtensions.cs rename to mixtape.Sqlite/Extensions/SqlExpressionExtensions.cs index a04e3bd4..cba17dd5 100644 --- a/Finch.Sqlite/Extensions/SqlExpressionExtensions.cs +++ b/mixtape.Sqlite/Extensions/SqlExpressionExtensions.cs @@ -1,9 +1,9 @@ using System; using System.Linq.Expressions; using ServiceStack.OrmLite; -using Finch.Extensions; +using Mixtape.Extensions; -namespace Finch.Sqlite; +namespace Mixtape.Sqlite; public static class SqlExpressionExtensions { diff --git a/Finch.Sqlite/ZeroSqliteModule.cs b/mixtape.Sqlite/MixtapeSqliteModule.cs similarity index 74% rename from Finch.Sqlite/ZeroSqliteModule.cs rename to mixtape.Sqlite/MixtapeSqliteModule.cs index 971fde63..9d447b60 100644 --- a/Finch.Sqlite/ZeroSqliteModule.cs +++ b/mixtape.Sqlite/MixtapeSqliteModule.cs @@ -4,22 +4,22 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using ServiceStack.Data; using ServiceStack.OrmLite; -using Finch.Configuration; -using Finch.Models; -using Finch.Modules; +using Mixtape.Configuration; +using Mixtape.Models; +using Mixtape.Modules; -namespace Finch.Sqlite; +namespace Mixtape.Sqlite; -public static class FinchBuilderExtensions +public static class MixtapeBuilderExtensions { - public static FinchBuilder AddSqlite(this FinchBuilder builder) + public static MixtapeBuilder AddSqlite(this MixtapeBuilder builder) { - builder.AddModule(); + builder.AddModule(); return builder; } } -internal class FinchSqliteModule : FinchModule +internal class MixtapeSqliteModule : MixtapeModule { public override void ConfigureServices(IServiceCollection services, IConfiguration configuration) { @@ -29,14 +29,14 @@ internal class FinchSqliteModule : FinchModule services.AddScoped(); services.AddScoped(); services.AddOptions(); - services.AddOptions().Bind(configuration.GetSection("Finch:Sqlite")); + services.AddOptions().Bind(configuration.GetSection("Mixtape:Sqlite")); services.ConfigureOptions(); } protected IDbConnectionFactory CreateDbConnectionFactory(IServiceProvider services) { - IFinchOptions options = services.GetService(); + IMixtapeOptions options = services.GetService(); SqliteOptions sqliteOptions = options.For(); return new OrmLiteConnectionFactory(sqliteOptions.ConnectionString, SqliteDialect.Provider); } @@ -45,7 +45,7 @@ internal class FinchSqliteModule : FinchModule protected IDbConnection CreateDbConnection(IServiceProvider services) { IDbConnectionFactory factory = services.GetService(); - IFinchOptions options = services.GetService(); + IMixtapeOptions options = services.GetService(); SqliteOptions sqliteOptions = options.For(); IDbConnection db = factory.CreateDbConnection(); db.Open(); diff --git a/Finch.Sqlite/Operations/DbOperations.Delete.cs b/mixtape.Sqlite/Operations/DbOperations.Delete.cs similarity index 84% rename from Finch.Sqlite/Operations/DbOperations.Delete.cs rename to mixtape.Sqlite/Operations/DbOperations.Delete.cs index 7ebe35b2..3c35470e 100644 --- a/Finch.Sqlite/Operations/DbOperations.Delete.cs +++ b/mixtape.Sqlite/Operations/DbOperations.Delete.cs @@ -2,19 +2,19 @@ using System.Threading.Tasks; using Microsoft.Extensions.Logging; using ServiceStack.OrmLite; -using Finch.Models; +using Mixtape.Models; -namespace Finch.Sqlite; +namespace Mixtape.Sqlite; public partial class DbOperations : IDbOperations { /// - public virtual Task> Delete(T model) where T : FinchIdEntity, new() + public virtual Task> Delete(T model) where T : MixtapeIdEntity, new() => Delete(model.Id); /// - public virtual async Task> Delete(string id) where T : FinchIdEntity, new() + public virtual async Task> Delete(string id) where T : MixtapeIdEntity, new() { T model = await Load(id); diff --git a/Finch.Sqlite/Operations/DbOperations.Read.cs b/mixtape.Sqlite/Operations/DbOperations.Read.cs similarity index 79% rename from Finch.Sqlite/Operations/DbOperations.Read.cs rename to mixtape.Sqlite/Operations/DbOperations.Read.cs index 6a0f2424..a2fa7132 100644 --- a/Finch.Sqlite/Operations/DbOperations.Read.cs +++ b/mixtape.Sqlite/Operations/DbOperations.Read.cs @@ -4,15 +4,15 @@ using System.Linq; using System.Linq.Expressions; using System.Threading.Tasks; using ServiceStack.OrmLite; -using Finch.Extensions; -using Finch.Models; +using Mixtape.Extensions; +using Mixtape.Models; -namespace Finch.Sqlite; +namespace Mixtape.Sqlite; public partial class DbOperations : IDbOperations { /// - public virtual async Task Load(string id, string changeVector = null) where T : FinchIdEntity, new() + public virtual async Task Load(string id, string changeVector = null) where T : MixtapeIdEntity, new() { if (id.IsNullOrWhiteSpace()) { @@ -28,7 +28,7 @@ public partial class DbOperations : IDbOperations /// - public virtual async Task> Load(IEnumerable ids) where T : FinchIdEntity, new() + public virtual async Task> Load(IEnumerable ids) where T : MixtapeIdEntity, new() { ids = ids.Distinct().ToArray(); @@ -46,7 +46,7 @@ public partial class DbOperations : IDbOperations /// - public virtual async Task> LoadAsList(IEnumerable ids) where T : FinchIdEntity, new() + public virtual async Task> LoadAsList(IEnumerable ids) where T : MixtapeIdEntity, new() { ids = ids.Distinct().ToArray(); @@ -67,35 +67,35 @@ public partial class DbOperations : IDbOperations /// - public virtual async Task Any(Expression> querySelector = null) where T : FinchIdEntity, new() + public virtual async Task Any(Expression> querySelector = null) where T : MixtapeIdEntity, new() { return await Db.ExistsAsync(querySelector ?? (x => true)); } /// - public virtual async Task> Load(Expression> querySelector) where T : FinchIdEntity, new() + public virtual async Task> Load(Expression> querySelector) where T : MixtapeIdEntity, new() { return await Db.SelectAsync(querySelector ?? (x => true)); } /// - public virtual async Task Find(Expression> querySelector) where T : FinchIdEntity, new() + public virtual async Task Find(Expression> querySelector) where T : MixtapeIdEntity, new() { return await Db.SingleAsync(querySelector); } /// - public virtual async Task> LoadBySql(Func, SqlExpression> querySelector) where T : FinchIdEntity, new() + public virtual async Task> LoadBySql(Func, SqlExpression> querySelector) where T : MixtapeIdEntity, new() { return await Db.SelectAsync(querySelector(Db.From())); } /// - public virtual async Task> LoadAll() where T : FinchIdEntity, new() + public virtual async Task> LoadAll() where T : MixtapeIdEntity, new() { return await Db.SelectAsync(x => true); } diff --git a/Finch.Sqlite/Operations/DbOperations.Write.cs b/mixtape.Sqlite/Operations/DbOperations.Write.cs similarity index 86% rename from Finch.Sqlite/Operations/DbOperations.Write.cs rename to mixtape.Sqlite/Operations/DbOperations.Write.cs index 0e3c6396..23defac4 100644 --- a/Finch.Sqlite/Operations/DbOperations.Write.cs +++ b/mixtape.Sqlite/Operations/DbOperations.Write.cs @@ -5,28 +5,28 @@ using System.Threading.Tasks; using FluentValidation.Results; using Microsoft.Extensions.Logging; using ServiceStack.OrmLite; -using Finch.Models; -using Finch.Extensions; +using Mixtape.Models; +using Mixtape.Extensions; -namespace Finch.Sqlite; +namespace Mixtape.Sqlite; public partial class DbOperations : IDbOperations { /// - public virtual Task> Create(T model, Func> validate = null) where T : FinchIdEntity, new() => Save(model, validate); + public virtual Task> Create(T model, Func> validate = null) where T : MixtapeIdEntity, new() => Save(model, validate); /// - public virtual Task> Update(T model, Func> validate = null) where T : FinchIdEntity, new() => Save(model, validate, true); + public virtual Task> Update(T model, Func> validate = null) where T : MixtapeIdEntity, new() => Save(model, validate, true); /// - public virtual async Task> CreateOrUpdate(T model, Func> validate = null) where T : FinchIdEntity, new() + public virtual async Task> CreateOrUpdate(T model, Func> validate = null) where T : MixtapeIdEntity, new() { bool update = !model.Id.IsNullOrEmpty() && await Any(x => x.Id == model.Id); return await Save(model, validate, update); } /// - protected virtual async Task> Save(T model, Func> validate = null, bool update = false) where T : FinchIdEntity, new() + protected virtual async Task> Save(T model, Func> validate = null, bool update = false) where T : MixtapeIdEntity, new() { if (model == null) { @@ -84,9 +84,9 @@ public partial class DbOperations : IDbOperations await Db.SaveAsync(model); string action = update ? "Updated" : "Created"; - if (model is FinchEntity finchEntity) + if (model is MixtapeEntity mixtapeEntity) { - Logger.LogInformation(action + " {id} with name {name}", model.Id, finchEntity.Name); + Logger.LogInformation(action + " {id} with name {name}", model.Id, mixtapeEntity.Name); } else { @@ -100,7 +100,7 @@ public partial class DbOperations : IDbOperations /// - public virtual async Task Sort(IEnumerable ids) where T : FinchEntity, new() + public virtual async Task Sort(IEnumerable ids) where T : MixtapeEntity, new() { List items = await LoadAll(); diff --git a/Finch.Sqlite/Operations/DbOperations.cs b/mixtape.Sqlite/Operations/DbOperations.cs similarity index 65% rename from Finch.Sqlite/Operations/DbOperations.cs rename to mixtape.Sqlite/Operations/DbOperations.cs index b46454c2..e1f0a130 100644 --- a/Finch.Sqlite/Operations/DbOperations.cs +++ b/mixtape.Sqlite/Operations/DbOperations.cs @@ -7,17 +7,17 @@ using System.Linq.Expressions; using System.Threading.Tasks; using Microsoft.Extensions.Logging; using ServiceStack.OrmLite; -using Finch.Communication; -using Finch.Context; -using Finch.Models; -using Finch.Utils; -using Finch.Validation; +using Mixtape.Communication; +using Mixtape.Context; +using Mixtape.Models; +using Mixtape.Utils; +using Mixtape.Validation; -namespace Finch.Sqlite; +namespace Mixtape.Sqlite; public partial class DbOperations : IDbOperations { - protected IFinchContext Context { get; private set; } + protected IMixtapeContext Context { get; private set; } protected FlavorOptions Flavors { get; } @@ -42,14 +42,14 @@ public partial class DbOperations : IDbOperations /// - public bool EnsureTableExists() where T : FinchIdEntity + public bool EnsureTableExists() where T : MixtapeIdEntity { return Db.CreateTableIfNotExists(); } /// - public Task GenerateId(T model) where T : FinchIdEntity + public Task GenerateId(T model) where T : MixtapeIdEntity { return Task.FromResult(IdGenerator.Create(12)); } @@ -63,35 +63,35 @@ public partial class DbOperations : IDbOperations /// - public T PrepareForSave(T model) where T : FinchIdEntity + public T PrepareForSave(T model) where T : MixtapeIdEntity { // set IDs AutoSetIds(model); - if (model is not FinchEntity finchModel) + if (model is not MixtapeEntity mixtapeModel) { return model; } // set default properties - if (finchModel.CreatedDate == default) + if (mixtapeModel.CreatedDate == default) { - finchModel.CreatedDate = DateTimeOffset.Now; + mixtapeModel.CreatedDate = DateTimeOffset.Now; } // update name alias and last modified - finchModel.Alias = Safenames.Alias(finchModel.Name); - finchModel.LastModifiedDate = DateTimeOffset.Now; - finchModel.Hash ??= IdGenerator.Create(); + mixtapeModel.Alias = Safenames.Alias(mixtapeModel.Name); + mixtapeModel.LastModifiedDate = DateTimeOffset.Now; + mixtapeModel.Hash ??= IdGenerator.Create(); return model; } /// - public async Task Validate(T model) where T : FinchIdEntity, new() + public async Task Validate(T model) where T : MixtapeIdEntity, new() { - IFinchMergedValidator validator = Services.GetService>(); + IMixtapeMergedValidator validator = Services.GetService>(); if (validator == null) { @@ -103,10 +103,10 @@ public partial class DbOperations : IDbOperations /// - public virtual T WhenActive(T model) where T : FinchIdEntity, new() + public virtual T WhenActive(T model) where T : MixtapeIdEntity, new() { return model; // TODO should we really use this? I tried to get data in a custom backend but couldn't because of this - //return model != null && (model is not FinchEntity || (model as FinchEntity).IsActive) && (model is not ISupportsSoftDelete || !(model as ISupportsSoftDelete).IsDeleted) ? model : default; + //return model != null && (model is not MixtapeEntity || (model as MixtapeEntity).IsActive) && (model is not ISupportsSoftDelete || !(model as ISupportsSoftDelete).IsDeleted) ? model : default; } } @@ -116,22 +116,22 @@ public interface IDbOperations /// /// Create a table if not existing /// - bool EnsureTableExists() where T : FinchIdEntity; + bool EnsureTableExists() where T : MixtapeIdEntity; /// /// Generate model Id by using configured document store conventions /// - Task GenerateId(T model) where T : FinchIdEntity; + Task GenerateId(T model) where T : MixtapeIdEntity; /// /// Do only return the model when it is set to active or inactive entities are included with IncludeInactive() /// - T WhenActive(T model) where T : FinchIdEntity, new(); + T WhenActive(T model) where T : MixtapeIdEntity, new(); /// /// Validates an entity /// - Task Validate(T model) where T : FinchIdEntity, new(); + Task Validate(T model) where T : MixtapeIdEntity, new(); /// /// Generate values for all properties (incl. nested) which contain the [GenerateId] attribute @@ -139,78 +139,78 @@ public interface IDbOperations T AutoSetIds(T model); /// - /// Automatically fill base properties of a FinchEntity + /// Automatically fill base properties of a MixtapeEntity /// - T PrepareForSave(T model) where T : FinchIdEntity; + T PrepareForSave(T model) where T : MixtapeIdEntity; /// /// Get an entity by Id /// - Task Load(string id, string changeVector = null) where T : FinchIdEntity, new(); + Task Load(string id, string changeVector = null) where T : MixtapeIdEntity, new(); /// /// Get entities by ids /// - Task> Load(IEnumerable ids) where T : FinchIdEntity, new(); + Task> Load(IEnumerable ids) where T : MixtapeIdEntity, new(); /// /// Get entities by ids /// - Task> LoadAsList(IEnumerable ids) where T : FinchIdEntity, new(); + Task> LoadAsList(IEnumerable ids) where T : MixtapeIdEntity, new(); /// /// Check if any items exist in this collection (with optional query) /// - Task Any(Expression> querySelector = null) where T : FinchIdEntity, new(); + Task Any(Expression> querySelector = null) where T : MixtapeIdEntity, new(); /// /// Get entities by query /// - Task> Load(Expression> querySelector) where T : FinchIdEntity, new(); + Task> Load(Expression> querySelector) where T : MixtapeIdEntity, new(); /// /// Find entity by query /// - Task Find(Expression> querySelector) where T : FinchIdEntity, new(); + Task Find(Expression> querySelector) where T : MixtapeIdEntity, new(); /// /// Get entities by sql query /// - Task> LoadBySql(Func, SqlExpression> querySelector) where T : FinchIdEntity, new(); + Task> LoadBySql(Func, SqlExpression> querySelector) where T : MixtapeIdEntity, new(); /// /// Get all entities from this collection. /// Warning: Don't use this method for large collections. Stream the results instead. /// - Task> LoadAll() where T : FinchIdEntity, new(); + Task> LoadAll() where T : MixtapeIdEntity, new(); /// /// Creates an entity with an optional validator /// - Task> Create(T model, Func> validate = null) where T : FinchIdEntity, new(); + Task> Create(T model, Func> validate = null) where T : MixtapeIdEntity, new(); /// /// Updates an entity with an optional validator /// - Task> Update(T model, Func> validate = null) where T : FinchIdEntity, new(); + Task> Update(T model, Func> validate = null) where T : MixtapeIdEntity, new(); /// /// Checks if an entity exists (via ID) and creates or updates it afterwards accordingly /// - Task> CreateOrUpdate(T model, Func> validate = null) where T : FinchIdEntity, new(); + Task> CreateOrUpdate(T model, Func> validate = null) where T : MixtapeIdEntity, new(); /// /// Updates sorting of all items in a collection based on the given enumerable /// - Task Sort(IEnumerable ids) where T : FinchEntity, new(); + Task Sort(IEnumerable ids) where T : MixtapeEntity, new(); /// /// Deletes an entity /// - Task> Delete(T model) where T : FinchIdEntity, new(); + Task> Delete(T model) where T : MixtapeIdEntity, new(); /// /// Deletes an entity /// - Task> Delete(string id) where T : FinchIdEntity, new(); + Task> Delete(string id) where T : MixtapeIdEntity, new(); } \ No newline at end of file diff --git a/mixtape.Sqlite/Operations/IEntityModifiedHandler.cs b/mixtape.Sqlite/Operations/IEntityModifiedHandler.cs new file mode 100644 index 00000000..e75d485e --- /dev/null +++ b/mixtape.Sqlite/Operations/IEntityModifiedHandler.cs @@ -0,0 +1,21 @@ +using System.Threading.Tasks; +using Mixtape.Communication; +using Mixtape.Models; + +namespace Mixtape.Sqlite; + +public interface IEntityModifiedHandler : IHandler +{ + Task Saved(T model, bool update) where T : MixtapeIdEntity, new() => update ? Updated(model) : Created(model); + Task Created(T model) where T : MixtapeIdEntity, new(); + Task Updated(T model) where T : MixtapeIdEntity, new(); + Task Deleted(T model) where T : MixtapeIdEntity, new(); +} + + +public class EmptyEntityModifiedHandler : IEntityModifiedHandler +{ + public Task Created(T model) where T : MixtapeIdEntity, new() => Task.CompletedTask; + public Task Updated(T model) where T : MixtapeIdEntity, new() => Task.CompletedTask; + public Task Deleted(T model) where T : MixtapeIdEntity, new() => Task.CompletedTask; +} \ No newline at end of file diff --git a/mixtape.Sqlite/Operations/StoreContext.cs b/mixtape.Sqlite/Operations/StoreContext.cs new file mode 100644 index 00000000..e0bf3287 --- /dev/null +++ b/mixtape.Sqlite/Operations/StoreContext.cs @@ -0,0 +1,26 @@ +using System; +using Mixtape.Communication; +using Mixtape.Configuration; +using Mixtape.Context; + +namespace Mixtape.Sqlite; + +public class StoreContext +{ + public IMixtapeContext Context { get; private set; } + + public IMixtapeOptions Options { get; private set; } + + public IServiceProvider Services { get; private set; } + + public IMessageAggregator Messages { get; private set; } + + + public StoreContext(IMixtapeContext context, IServiceProvider serviceProvider, IMessageAggregator messages) + { + Options = context.Options; + Context = context; + Services = serviceProvider; + Messages = messages; + } +} \ No newline at end of file diff --git a/Finch.Sqlite/SqliteOptions.cs b/mixtape.Sqlite/SqliteOptions.cs similarity index 87% rename from Finch.Sqlite/SqliteOptions.cs rename to mixtape.Sqlite/SqliteOptions.cs index 838a74be..bed4db48 100644 --- a/Finch.Sqlite/SqliteOptions.cs +++ b/mixtape.Sqlite/SqliteOptions.cs @@ -1,7 +1,7 @@ using System; using System.Data; -namespace Finch.Sqlite; +namespace Mixtape.Sqlite; public class SqliteOptions { diff --git a/Finch.Sqlite/Finch.Sqlite.csproj b/mixtape.Sqlite/mixtape.Sqlite.csproj similarity index 75% rename from Finch.Sqlite/Finch.Sqlite.csproj rename to mixtape.Sqlite/mixtape.Sqlite.csproj index a215eab1..3e0c9e67 100644 --- a/Finch.Sqlite/Finch.Sqlite.csproj +++ b/mixtape.Sqlite/mixtape.Sqlite.csproj @@ -1,11 +1,11 @@  - Finch.Sqlite + Mixtape.Sqlite 1.0.0 net8.0;net9.0;net10.0 true - Finch.Sqlite + Mixtape.Sqlite embedded @@ -15,7 +15,7 @@ - + \ No newline at end of file diff --git a/Finch.sln b/mixtape.sln similarity index 79% rename from Finch.sln rename to mixtape.sln index f3a2832d..a3699398 100644 --- a/Finch.sln +++ b/mixtape.sln @@ -3,11 +3,11 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.0.31912.275 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Finch", "Finch\Finch.csproj", "{33CD6E46-CD81-42C3-9019-C0EAD557EE99}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "mixtape", "mixtape\mixtape.csproj", "{33CD6E46-CD81-42C3-9019-C0EAD557EE99}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Finch.Raven", "Finch.Raven\Finch.Raven.csproj", "{DC79D7EA-FAA1-4701-9C36-8295CD1C45D0}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "mixtape.Raven", "mixtape.Raven\mixtape.Raven.csproj", "{DC79D7EA-FAA1-4701-9C36-8295CD1C45D0}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Finch.Sqlite", "Finch.Sqlite\Finch.Sqlite.csproj", "{A57D88BC-952F-4311-B474-26FBF0FA957E}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "mixtape.Sqlite", "mixtape.Sqlite\mixtape.Sqlite.csproj", "{A57D88BC-952F-4311-B474-26FBF0FA957E}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/Finch/ApplicationBuilderExtensions.cs b/mixtape/ApplicationBuilderExtensions.cs similarity index 69% rename from Finch/ApplicationBuilderExtensions.cs rename to mixtape/ApplicationBuilderExtensions.cs index 1fefc36c..834a74fa 100644 --- a/Finch/ApplicationBuilderExtensions.cs +++ b/mixtape/ApplicationBuilderExtensions.cs @@ -3,13 +3,13 @@ using Microsoft.AspNetCore.Routing; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; -namespace Finch; +namespace Mixtape; public static class ApplicationBuilderExtensions { - public static IApplicationBuilder UseFinch(this IApplicationBuilder app) + public static IApplicationBuilder UseMixtape(this IApplicationBuilder app) { - app.UseMiddleware(); + app.UseMiddleware(); app.UseResponseCaching(); IHostEnvironment env = app.ApplicationServices.GetRequiredService(); @@ -24,7 +24,7 @@ public static class ApplicationBuilderExtensions webApplication.MapControllers(); } - FinchBuilder.Modules.Configure(app, app as IEndpointRouteBuilder, app.ApplicationServices); + MixtapeBuilder.Modules.Configure(app, app as IEndpointRouteBuilder, app.ApplicationServices); return app; } } diff --git a/Finch/Assemblies/AssemblyDiscovery.cs b/mixtape/Assemblies/AssemblyDiscovery.cs similarity index 99% rename from Finch/Assemblies/AssemblyDiscovery.cs rename to mixtape/Assemblies/AssemblyDiscovery.cs index c82a4b7e..03746d93 100644 --- a/Finch/Assemblies/AssemblyDiscovery.cs +++ b/mixtape/Assemblies/AssemblyDiscovery.cs @@ -3,7 +3,7 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyModel; using System.Reflection; -namespace Finch.Assemblies; +namespace Mixtape.Assemblies; public class AssemblyDiscovery : IAssemblyDiscovery { diff --git a/Finch/Assemblies/AssemblyDiscoveryContext.cs b/mixtape/Assemblies/AssemblyDiscoveryContext.cs similarity index 94% rename from Finch/Assemblies/AssemblyDiscoveryContext.cs rename to mixtape/Assemblies/AssemblyDiscoveryContext.cs index 338c63f2..61a8ae4e 100644 --- a/Finch/Assemblies/AssemblyDiscoveryContext.cs +++ b/mixtape/Assemblies/AssemblyDiscoveryContext.cs @@ -1,6 +1,6 @@ using System.Reflection; -namespace Finch.Assemblies; +namespace Mixtape.Assemblies; public class AssemblyDiscoveryContext { diff --git a/Finch/Assemblies/IAssemblyDiscoveryRule.cs b/mixtape/Assemblies/IAssemblyDiscoveryRule.cs similarity index 91% rename from Finch/Assemblies/IAssemblyDiscoveryRule.cs rename to mixtape/Assemblies/IAssemblyDiscoveryRule.cs index 988fb894..d2848423 100644 --- a/Finch/Assemblies/IAssemblyDiscoveryRule.cs +++ b/mixtape/Assemblies/IAssemblyDiscoveryRule.cs @@ -1,6 +1,6 @@ using Microsoft.Extensions.DependencyModel; -namespace Finch.Assemblies; +namespace Mixtape.Assemblies; public interface IAssemblyDiscoveryRule { diff --git a/mixtape/Assemblies/MixtapeAssemblyDiscoveryRule.cs b/mixtape/Assemblies/MixtapeAssemblyDiscoveryRule.cs new file mode 100644 index 00000000..890a756f --- /dev/null +++ b/mixtape/Assemblies/MixtapeAssemblyDiscoveryRule.cs @@ -0,0 +1,16 @@ +using Microsoft.Extensions.DependencyModel; + +namespace Mixtape.Assemblies; + +public class MixtapeAssemblyDiscoveryRule : IAssemblyDiscoveryRule +{ + const string MixtapePrefix = "Mixtape."; + + /// + public bool IsValid(RuntimeLibrary library, AssemblyDiscoveryContext context) + { + StringComparison casing = StringComparison.OrdinalIgnoreCase; + // TODO we need to auto-add assemblies and discover their types which have implementations of IMixtapePlugin + return library.Name.StartsWith(MixtapePrefix, casing) || (context.HasEntryAssembly && library.Name.Contains(context.EntryAssemblyName, casing)); + } +} \ No newline at end of file diff --git a/mixtape/Communication/Handlers/IHandler.cs b/mixtape/Communication/Handlers/IHandler.cs new file mode 100644 index 00000000..e3e6fbec --- /dev/null +++ b/mixtape/Communication/Handlers/IHandler.cs @@ -0,0 +1,5 @@ +namespace Mixtape.Communication; + +public interface IHandler +{ +} diff --git a/Finch/Communication/Handlers/IHandlerHolder.cs b/mixtape/Communication/Handlers/IHandlerHolder.cs similarity index 94% rename from Finch/Communication/Handlers/IHandlerHolder.cs rename to mixtape/Communication/Handlers/IHandlerHolder.cs index f60ad375..f452f2b8 100644 --- a/Finch/Communication/Handlers/IHandlerHolder.cs +++ b/mixtape/Communication/Handlers/IHandlerHolder.cs @@ -1,6 +1,6 @@ using Microsoft.Extensions.DependencyInjection; -namespace Finch.Communication; +namespace Mixtape.Communication; public class HandlerHolder : IHandlerHolder { diff --git a/Finch/Communication/LazilyResolved.cs b/mixtape/Communication/LazilyResolved.cs similarity index 86% rename from Finch/Communication/LazilyResolved.cs rename to mixtape/Communication/LazilyResolved.cs index e9ebb223..3ba60f58 100644 --- a/Finch/Communication/LazilyResolved.cs +++ b/mixtape/Communication/LazilyResolved.cs @@ -1,6 +1,6 @@ using Microsoft.Extensions.DependencyInjection; -namespace Finch.Communication; +namespace Mixtape.Communication; public class LazilyResolved : Lazy { diff --git a/Finch/Communication/Messages/IMessage.cs b/mixtape/Communication/Messages/IMessage.cs similarity index 51% rename from Finch/Communication/Messages/IMessage.cs rename to mixtape/Communication/Messages/IMessage.cs index 3adae38c..efb65337 100644 --- a/Finch/Communication/Messages/IMessage.cs +++ b/mixtape/Communication/Messages/IMessage.cs @@ -1,5 +1,5 @@  -namespace Finch.Communication; +namespace Mixtape.Communication; public interface IMessage { diff --git a/Finch/Communication/Messages/IMessageHandler.cs b/mixtape/Communication/Messages/IMessageHandler.cs similarity index 95% rename from Finch/Communication/Messages/IMessageHandler.cs rename to mixtape/Communication/Messages/IMessageHandler.cs index 4e93782d..e3c45c1b 100644 --- a/Finch/Communication/Messages/IMessageHandler.cs +++ b/mixtape/Communication/Messages/IMessageHandler.cs @@ -1,4 +1,4 @@ -namespace Finch.Communication; +namespace Mixtape.Communication; /// /// Indicates a handler that can perform an action when a message of diff --git a/Finch/Communication/Messages/MessageAggregator.cs b/mixtape/Communication/Messages/MessageAggregator.cs similarity index 98% rename from Finch/Communication/Messages/MessageAggregator.cs rename to mixtape/Communication/Messages/MessageAggregator.cs index 3a7392c2..94518ab1 100644 --- a/Finch/Communication/Messages/MessageAggregator.cs +++ b/mixtape/Communication/Messages/MessageAggregator.cs @@ -1,7 +1,7 @@ using System.Collections.Concurrent; using System.Linq.Expressions; -namespace Finch.Communication; +namespace Mixtape.Communication; public class MessageAggregator : IMessageAggregator { diff --git a/Finch/Communication/Messages/MessageSubscription.cs b/mixtape/Communication/Messages/MessageSubscription.cs similarity index 98% rename from Finch/Communication/Messages/MessageSubscription.cs rename to mixtape/Communication/Messages/MessageSubscription.cs index 173d8598..e411417d 100644 --- a/Finch/Communication/Messages/MessageSubscription.cs +++ b/mixtape/Communication/Messages/MessageSubscription.cs @@ -2,7 +2,7 @@ using System.Linq.Expressions; using System.Reflection; -namespace Finch.Communication; +namespace Mixtape.Communication; internal class MessageSubscription : IMessageSubscription where TMessage : class, IMessage diff --git a/Finch/Communication/FinchCommunicationModule.cs b/mixtape/Communication/MixtapeCommunicationModule.cs similarity index 81% rename from Finch/Communication/FinchCommunicationModule.cs rename to mixtape/Communication/MixtapeCommunicationModule.cs index c4a35928..18bbd485 100644 --- a/Finch/Communication/FinchCommunicationModule.cs +++ b/mixtape/Communication/MixtapeCommunicationModule.cs @@ -1,9 +1,9 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; -namespace Finch.Communication; +namespace Mixtape.Communication; -internal class FinchCommunicationModule : FinchModule +internal class MixtapeCommunicationModule : MixtapeModule { public override void ConfigureServices(IServiceCollection services, IConfiguration configuration) { diff --git a/mixtape/Configuration/IMixtapeCollectionOptions.cs b/mixtape/Configuration/IMixtapeCollectionOptions.cs new file mode 100644 index 00000000..9acc7740 --- /dev/null +++ b/mixtape/Configuration/IMixtapeCollectionOptions.cs @@ -0,0 +1,6 @@ +namespace Mixtape.Configuration; + +public interface IMixtapeCollectionOptions +{ + +} \ No newline at end of file diff --git a/Finch/Configuration/FinchConfigurationModule.cs b/mixtape/Configuration/MixtapeConfigurationModule.cs similarity index 57% rename from Finch/Configuration/FinchConfigurationModule.cs rename to mixtape/Configuration/MixtapeConfigurationModule.cs index 9d6262b3..aed9f69a 100644 --- a/Finch/Configuration/FinchConfigurationModule.cs +++ b/mixtape/Configuration/MixtapeConfigurationModule.cs @@ -2,22 +2,22 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; -namespace Finch.Configuration; +namespace Mixtape.Configuration; -internal class FinchConfigurationModule : FinchModule +internal class MixtapeConfigurationModule : MixtapeModule { public override int Order => -1000; public override void ConfigureServices(IServiceCollection services, IConfiguration configuration) { - services.AddOptions().Configure((opts, svc) => + services.AddOptions().Configure((opts, svc) => { opts.ServiceProvider = svc; opts.Version = "1.0.0-alpha.1"; opts.TokenExpiration = TimeSpan.FromHours(3); opts.DataProtectionStoragePath = "../cache/dpkeys"; - }).Bind(configuration.GetSection("Finch")); + }).Bind(configuration.GetSection("Mixtape")); - services.AddTransient(factory => factory.GetService>().Value); + services.AddTransient(factory => factory.GetService>().Value); } } \ No newline at end of file diff --git a/Finch/Configuration/FinchOptions.cs b/mixtape/Configuration/MixtapeOptions.cs similarity index 94% rename from Finch/Configuration/FinchOptions.cs rename to mixtape/Configuration/MixtapeOptions.cs index d8b96382..363324a6 100644 --- a/Finch/Configuration/FinchOptions.cs +++ b/mixtape/Configuration/MixtapeOptions.cs @@ -2,9 +2,9 @@ using Microsoft.Extensions.Options; using System.Collections.Concurrent; -namespace Finch.Configuration; +namespace Mixtape.Configuration; -public class FinchOptions : IFinchOptions +public class MixtapeOptions : IMixtapeOptions { /// public string Version { get; set; } @@ -44,7 +44,7 @@ public class FinchOptions : IFinchOptions } -public interface IFinchOptions +public interface IMixtapeOptions { /// /// The currently active version diff --git a/Finch/Configuration/FinchStartupOptions.cs b/mixtape/Configuration/MixtapeStartupOptions.cs similarity index 66% rename from Finch/Configuration/FinchStartupOptions.cs rename to mixtape/Configuration/MixtapeStartupOptions.cs index 07068001..3d3d7996 100644 --- a/Finch/Configuration/FinchStartupOptions.cs +++ b/mixtape/Configuration/MixtapeStartupOptions.cs @@ -1,15 +1,15 @@ using Microsoft.Extensions.DependencyInjection; -namespace Finch.Configuration; +namespace Mixtape.Configuration; -public class FinchStartupOptions(IMvcBuilder mvc) : IFinchStartupOptions +public class MixtapeStartupOptions(IMvcBuilder mvc) : IMixtapeStartupOptions { public IList AssemblyDiscoveryRules { get; } = new List(); public IMvcBuilder Mvc { get; } = mvc; } -public interface IFinchStartupOptions +public interface IMixtapeStartupOptions { IList AssemblyDiscoveryRules { get; } diff --git a/Finch/Configuration/OptionsType.cs b/mixtape/Configuration/OptionsType.cs similarity index 93% rename from Finch/Configuration/OptionsType.cs rename to mixtape/Configuration/OptionsType.cs index d0ce5114..ffc8eb73 100644 --- a/Finch/Configuration/OptionsType.cs +++ b/mixtape/Configuration/OptionsType.cs @@ -1,6 +1,6 @@ using FluentValidation; -namespace Finch.Configuration; +namespace Mixtape.Configuration; public abstract class OptionsType { diff --git a/Finch/Context/FinchContext.cs b/mixtape/Context/MixtapeContext.cs similarity index 77% rename from Finch/Context/FinchContext.cs rename to mixtape/Context/MixtapeContext.cs index 0aaf6bea..cf86e670 100644 --- a/Finch/Context/FinchContext.cs +++ b/mixtape/Context/MixtapeContext.cs @@ -1,15 +1,15 @@ using Microsoft.AspNetCore.Http; -namespace Finch.Context; +namespace Mixtape.Context; -public class FinchContext( - IFinchOptions options, +public class MixtapeContext( + IMixtapeOptions options, ICultureResolver cultureResolver, IServiceProvider services) - : IFinchContext + : IMixtapeContext { /// - public IFinchOptions Options { get; } = options; + public IMixtapeOptions Options { get; } = options; /// public IServiceProvider Services { get; } = services; @@ -35,12 +35,12 @@ public class FinchContext( -public interface IFinchContext +public interface IMixtapeContext { /// - /// Global finch options + /// Global mixtape options /// - IFinchOptions Options { get; } + IMixtapeOptions Options { get; } /// /// Service container diff --git a/mixtape/Context/MixtapeContextMiddleware.cs b/mixtape/Context/MixtapeContextMiddleware.cs new file mode 100644 index 00000000..e2a8e35f --- /dev/null +++ b/mixtape/Context/MixtapeContextMiddleware.cs @@ -0,0 +1,13 @@ +using Microsoft.AspNetCore.Http; + +namespace Mixtape.Context +{ + public class MixtapeContextMiddleware(RequestDelegate next) + { + public async Task Invoke(HttpContext httpContext, IMixtapeContext mixtapeContext) + { + await mixtapeContext.Resolve(httpContext); + await next(httpContext); + } + } +} diff --git a/Finch/Context/FinchContextModule.cs b/mixtape/Context/MixtapeContextModule.cs similarity index 63% rename from Finch/Context/FinchContextModule.cs rename to mixtape/Context/MixtapeContextModule.cs index af2d3375..6e5dc6ff 100644 --- a/Finch/Context/FinchContextModule.cs +++ b/mixtape/Context/MixtapeContextModule.cs @@ -1,13 +1,13 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; -namespace Finch.Context; +namespace Mixtape.Context; -internal class FinchContextModule : FinchModule +internal class MixtapeContextModule : MixtapeModule { public override void ConfigureServices(IServiceCollection services, IConfiguration configuration) { - services.AddScoped(); + services.AddScoped(); services.AddHttpContextAccessor(); } } \ No newline at end of file diff --git a/Finch/Extensions/CharExtensions.cs b/mixtape/Extensions/CharExtensions.cs similarity index 97% rename from Finch/Extensions/CharExtensions.cs rename to mixtape/Extensions/CharExtensions.cs index ec414867..b0a8ed96 100644 --- a/Finch/Extensions/CharExtensions.cs +++ b/mixtape/Extensions/CharExtensions.cs @@ -1,4 +1,4 @@ -namespace Finch.Extensions; +namespace Mixtape.Extensions; public static class CharExtensions { diff --git a/Finch/Extensions/ColorExtensions.cs b/mixtape/Extensions/ColorExtensions.cs similarity index 98% rename from Finch/Extensions/ColorExtensions.cs rename to mixtape/Extensions/ColorExtensions.cs index efe8d90a..7b16d8db 100644 --- a/Finch/Extensions/ColorExtensions.cs +++ b/mixtape/Extensions/ColorExtensions.cs @@ -1,6 +1,6 @@ using System.Drawing; -namespace Finch.Extensions; +namespace Mixtape.Extensions; public static class ColorExtensions { diff --git a/Finch/Extensions/DictionaryExtensions.cs b/mixtape/Extensions/DictionaryExtensions.cs similarity index 96% rename from Finch/Extensions/DictionaryExtensions.cs rename to mixtape/Extensions/DictionaryExtensions.cs index e687ca6b..ee5b4dae 100644 --- a/Finch/Extensions/DictionaryExtensions.cs +++ b/mixtape/Extensions/DictionaryExtensions.cs @@ -1,4 +1,4 @@ -namespace Finch.Extensions; +namespace Mixtape.Extensions; public static class DictionaryExtensions { diff --git a/Finch/Extensions/EnumerableExtensions.cs b/mixtape/Extensions/EnumerableExtensions.cs similarity index 96% rename from Finch/Extensions/EnumerableExtensions.cs rename to mixtape/Extensions/EnumerableExtensions.cs index a60016ab..1b4bdbd6 100644 --- a/Finch/Extensions/EnumerableExtensions.cs +++ b/mixtape/Extensions/EnumerableExtensions.cs @@ -1,4 +1,4 @@ -namespace Finch.Extensions; +namespace Mixtape.Extensions; public static class EnumerableExtensions { diff --git a/Finch/Extensions/ExpressionExtensions.cs b/mixtape/Extensions/ExpressionExtensions.cs similarity index 97% rename from Finch/Extensions/ExpressionExtensions.cs rename to mixtape/Extensions/ExpressionExtensions.cs index 9ae30b68..31d927e1 100644 --- a/Finch/Extensions/ExpressionExtensions.cs +++ b/mixtape/Extensions/ExpressionExtensions.cs @@ -1,7 +1,7 @@ using System.Linq.Expressions; using System.Text; -namespace Finch.Extensions; +namespace Mixtape.Extensions; public static class ExpressionExtensions { diff --git a/Finch/Extensions/HttpContextExtensions.cs b/mixtape/Extensions/HttpContextExtensions.cs similarity index 98% rename from Finch/Extensions/HttpContextExtensions.cs rename to mixtape/Extensions/HttpContextExtensions.cs index 0f5e2968..65cb8e4b 100644 --- a/Finch/Extensions/HttpContextExtensions.cs +++ b/mixtape/Extensions/HttpContextExtensions.cs @@ -1,6 +1,6 @@ using Microsoft.AspNetCore.Http; -namespace Finch.Extensions; +namespace Mixtape.Extensions; public static class HttpContextExtensions { diff --git a/Finch/Extensions/NumberExtensions.cs b/mixtape/Extensions/NumberExtensions.cs similarity index 97% rename from Finch/Extensions/NumberExtensions.cs rename to mixtape/Extensions/NumberExtensions.cs index 071aecec..b33f16ac 100644 --- a/Finch/Extensions/NumberExtensions.cs +++ b/mixtape/Extensions/NumberExtensions.cs @@ -1,4 +1,4 @@ -namespace Finch.Extensions; +namespace Mixtape.Extensions; public static class NumberExtensions { diff --git a/Finch/Extensions/ObjectExtensions.cs b/mixtape/Extensions/ObjectExtensions.cs similarity index 95% rename from Finch/Extensions/ObjectExtensions.cs rename to mixtape/Extensions/ObjectExtensions.cs index 271af136..74c2cad0 100644 --- a/Finch/Extensions/ObjectExtensions.cs +++ b/mixtape/Extensions/ObjectExtensions.cs @@ -1,6 +1,6 @@ //using Newtonsoft.Json; -//namespace Finch.Extensions; +//namespace Mixtape.Extensions; //[Obsolete("we don't want this for every object (use a Utils class instead)")] //public static class ObjectExtensions diff --git a/Finch/Extensions/ResultExtensions.cs b/mixtape/Extensions/ResultExtensions.cs similarity index 91% rename from Finch/Extensions/ResultExtensions.cs rename to mixtape/Extensions/ResultExtensions.cs index a32d88be..5a0f5908 100644 --- a/Finch/Extensions/ResultExtensions.cs +++ b/mixtape/Extensions/ResultExtensions.cs @@ -1,4 +1,4 @@ -namespace Finch.Extensions; +namespace Mixtape.Extensions; public static class ResultExtensions { @@ -31,7 +31,7 @@ public static class ResultExtensions public static Result AddError(this Result origin, string message) { origin.IsSuccess = false; - origin.Errors.Add(new("__finch_no_field", message)); + origin.Errors.Add(new("__mixtape_no_field", message)); return origin; } diff --git a/Finch/Extensions/ServiceCollectionExtensions.cs b/mixtape/Extensions/ServiceCollectionExtensions.cs similarity index 98% rename from Finch/Extensions/ServiceCollectionExtensions.cs rename to mixtape/Extensions/ServiceCollectionExtensions.cs index 06b8f440..856ed8a7 100644 --- a/Finch/Extensions/ServiceCollectionExtensions.cs +++ b/mixtape/Extensions/ServiceCollectionExtensions.cs @@ -2,7 +2,7 @@ using Microsoft.Extensions.DependencyInjection.Extensions; using System.Reflection; -namespace Finch.Extensions; +namespace Mixtape.Extensions; public static class ServiceCollectionExtensions { @@ -19,7 +19,7 @@ public static class ServiceCollectionExtensions { if (AssemblyDiscovery.Current == null) { - throw new Exception("services.AddAll() can only be run after mvcBuilder.AddFinch()"); + throw new Exception("services.AddAll() can only be run after mvcBuilder.AddMixtape()"); } // add implementations with generic service types diff --git a/Finch/Extensions/StringExtensions.cs b/mixtape/Extensions/StringExtensions.cs similarity index 99% rename from Finch/Extensions/StringExtensions.cs rename to mixtape/Extensions/StringExtensions.cs index d5c5c257..b1d863fa 100644 --- a/Finch/Extensions/StringExtensions.cs +++ b/mixtape/Extensions/StringExtensions.cs @@ -4,7 +4,7 @@ using System.Text; using System.Text.RegularExpressions; using Microsoft.AspNetCore.Html; -namespace Finch.Extensions; +namespace Mixtape.Extensions; public static class StringExtensions { diff --git a/Finch/FileStorage/FileResult.cs b/mixtape/FileStorage/FileResult.cs similarity index 81% rename from Finch/FileStorage/FileResult.cs rename to mixtape/FileStorage/FileResult.cs index 5a83d7ce..121d0cb1 100644 --- a/Finch/FileStorage/FileResult.cs +++ b/mixtape/FileStorage/FileResult.cs @@ -1,4 +1,4 @@ -namespace Finch.FileStorage; +namespace Mixtape.FileStorage; public class FileResult { diff --git a/Finch/FileStorage/FileSizeNotation.cs b/mixtape/FileStorage/FileSizeNotation.cs similarity index 92% rename from Finch/FileStorage/FileSizeNotation.cs rename to mixtape/FileStorage/FileSizeNotation.cs index ddf21970..07e3ed4a 100644 --- a/Finch/FileStorage/FileSizeNotation.cs +++ b/mixtape/FileStorage/FileSizeNotation.cs @@ -1,4 +1,4 @@ -namespace Finch.FileStorage; +namespace Mixtape.FileStorage; public enum FileSizeNotation { diff --git a/Finch/FileStorage/FileSystemException.cs b/mixtape/FileStorage/FileSystemException.cs similarity index 88% rename from Finch/FileStorage/FileSystemException.cs rename to mixtape/FileStorage/FileSystemException.cs index d8642d0e..cd9747c4 100644 --- a/Finch/FileStorage/FileSystemException.cs +++ b/mixtape/FileStorage/FileSystemException.cs @@ -1,4 +1,4 @@ -namespace Finch.FileStorage; +namespace Mixtape.FileStorage; public class FileSystemException : Exception { diff --git a/mixtape/FileStorage/FileSystemOptions.cs b/mixtape/FileStorage/FileSystemOptions.cs new file mode 100644 index 00000000..dcabbc2e --- /dev/null +++ b/mixtape/FileStorage/FileSystemOptions.cs @@ -0,0 +1,6 @@ +namespace Mixtape.FileStorage; + +public class FileSystemOptions +{ + public string MixtapeAssetsPath { get; set; } +} \ No newline at end of file diff --git a/Finch/FileStorage/FinchFileStorageModule.cs b/mixtape/FileStorage/FinchFileStorageModule.cs similarity index 77% rename from Finch/FileStorage/FinchFileStorageModule.cs rename to mixtape/FileStorage/FinchFileStorageModule.cs index 34fbc160..acdd43a2 100644 --- a/Finch/FileStorage/FinchFileStorageModule.cs +++ b/mixtape/FileStorage/FinchFileStorageModule.cs @@ -2,17 +2,17 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; -namespace Finch.FileStorage; +namespace Mixtape.FileStorage; -internal class FinchFileStorageModule : FinchModule +internal class MixtapeFileStorageModule : MixtapeModule { public override void ConfigureServices(IServiceCollection services, IConfiguration configuration) { services.AddScoped(factory => new Paths(factory.GetService())); - services.AddOptions().Bind(configuration.GetSection("Finch:FileSystem")).Configure(opts => + services.AddOptions().Bind(configuration.GetSection("Mixtape:FileSystem")).Configure(opts => { - opts.FinchAssetsPath = "finch"; + opts.MixtapeAssetsPath = "mixtape"; }); services.AddSingleton(svc => diff --git a/Finch/FileStorage/IFileMeta.cs b/mixtape/FileStorage/IFileMeta.cs similarity index 96% rename from Finch/FileStorage/IFileMeta.cs rename to mixtape/FileStorage/IFileMeta.cs index 94c4798b..49e7b856 100644 --- a/Finch/FileStorage/IFileMeta.cs +++ b/mixtape/FileStorage/IFileMeta.cs @@ -1,4 +1,4 @@ -namespace Finch.FileStorage; +namespace Mixtape.FileStorage; public interface IFileMeta { diff --git a/Finch/FileStorage/IFileSystem.cs b/mixtape/FileStorage/IFileSystem.cs similarity index 98% rename from Finch/FileStorage/IFileSystem.cs rename to mixtape/FileStorage/IFileSystem.cs index 5e3d185d..78a2e6f6 100644 --- a/Finch/FileStorage/IFileSystem.cs +++ b/mixtape/FileStorage/IFileSystem.cs @@ -1,6 +1,6 @@ using System.IO; -namespace Finch.FileStorage; +namespace Mixtape.FileStorage; public interface IFileSystem { diff --git a/Finch/FileStorage/Paths.cs b/mixtape/FileStorage/Paths.cs similarity index 99% rename from Finch/FileStorage/Paths.cs rename to mixtape/FileStorage/Paths.cs index b7230975..4ea4b864 100644 --- a/Finch/FileStorage/Paths.cs +++ b/mixtape/FileStorage/Paths.cs @@ -3,7 +3,7 @@ using Microsoft.AspNetCore.StaticFiles; using System.IO; using System.Text; -namespace Finch.FileStorage; +namespace Mixtape.FileStorage; public class Paths : IPaths { diff --git a/Finch/FileStorage/PhysicalFileMeta.cs b/mixtape/FileStorage/PhysicalFileMeta.cs similarity index 96% rename from Finch/FileStorage/PhysicalFileMeta.cs rename to mixtape/FileStorage/PhysicalFileMeta.cs index 38eba703..de2a99d3 100644 --- a/Finch/FileStorage/PhysicalFileMeta.cs +++ b/mixtape/FileStorage/PhysicalFileMeta.cs @@ -1,6 +1,6 @@ using Microsoft.Extensions.FileProviders; -namespace Finch.FileStorage; +namespace Mixtape.FileStorage; public class PhysicalFileMeta : IFileMeta { diff --git a/Finch/FileStorage/PhysicalFileSystem.cs b/mixtape/FileStorage/PhysicalFileSystem.cs similarity index 99% rename from Finch/FileStorage/PhysicalFileSystem.cs rename to mixtape/FileStorage/PhysicalFileSystem.cs index 556a3f24..69addf0f 100644 --- a/Finch/FileStorage/PhysicalFileSystem.cs +++ b/mixtape/FileStorage/PhysicalFileSystem.cs @@ -1,7 +1,7 @@ using Microsoft.Extensions.FileProviders.Physical; using System.IO; -namespace Finch.FileStorage; +namespace Mixtape.FileStorage; public class PhysicalFileSystem : IFileSystem { diff --git a/Finch/FileStorage/WebRootFileSystem.cs b/mixtape/FileStorage/WebRootFileSystem.cs similarity index 94% rename from Finch/FileStorage/WebRootFileSystem.cs rename to mixtape/FileStorage/WebRootFileSystem.cs index 1b75cccf..ade2af4a 100644 --- a/Finch/FileStorage/WebRootFileSystem.cs +++ b/mixtape/FileStorage/WebRootFileSystem.cs @@ -1,4 +1,4 @@ -namespace Finch.FileStorage; +namespace Mixtape.FileStorage; public class WebRootFileSystem : PhysicalFileSystem, IWebRootFileSystem { diff --git a/Finch/Frontend/FinchViteModule.cs b/mixtape/Frontend/MixtapeViteModule.cs similarity index 92% rename from Finch/Frontend/FinchViteModule.cs rename to mixtape/Frontend/MixtapeViteModule.cs index cf5ed710..6ee7840b 100644 --- a/Finch/Frontend/FinchViteModule.cs +++ b/mixtape/Frontend/MixtapeViteModule.cs @@ -3,14 +3,14 @@ using ViteProxy; #endif -namespace Finch.Frontend; +namespace Mixtape.Frontend; -public static class FinchBuilderExtensions +public static class MixtapeBuilderExtensions { - public static FinchBuilder AddVite(this FinchBuilder builder) + public static MixtapeBuilder AddVite(this MixtapeBuilder builder) { #if DEBUG - builder.Services.AddViteProxy("Finch:Vite"); + builder.Services.AddViteProxy("Mixtape:Vite"); #endif return builder; } @@ -27,7 +27,7 @@ public static class ViteProxyApplicationBuilderExtensions } } -// internal class FinchViteModule : FinchModule +// internal class MixtapeViteModule : MixtapeModule // { // public override int ConfigureOrder { get; } = -1; // diff --git a/Finch/Frontend/ViteScriptTagHelper.cs b/mixtape/Frontend/ViteScriptTagHelper.cs similarity index 91% rename from Finch/Frontend/ViteScriptTagHelper.cs rename to mixtape/Frontend/ViteScriptTagHelper.cs index f309c61f..e715ba93 100644 --- a/Finch/Frontend/ViteScriptTagHelper.cs +++ b/mixtape/Frontend/ViteScriptTagHelper.cs @@ -5,10 +5,10 @@ using Microsoft.AspNetCore.Mvc.ViewFeatures; using Microsoft.AspNetCore.Razor.TagHelpers; using Microsoft.Extensions.Hosting; -namespace Finch.Frontend; +namespace Mixtape.Frontend; [HtmlTargetElement("app-vitescript", Attributes = "src", TagStructure = TagStructure.NormalOrSelfClosing)] -public class ViteScriptTagHelper(IWebHostEnvironment env, IFinchOptions options) : TagHelper +public class ViteScriptTagHelper(IWebHostEnvironment env, IMixtapeOptions options) : TagHelper { [HtmlAttributeNotBound] [ViewContext] diff --git a/Finch/Identity/IdentityBuilderExtensions.cs b/mixtape/Identity/IdentityBuilderExtensions.cs similarity index 61% rename from Finch/Identity/IdentityBuilderExtensions.cs rename to mixtape/Identity/IdentityBuilderExtensions.cs index 661dc9a6..c3f5b90e 100644 --- a/Finch/Identity/IdentityBuilderExtensions.cs +++ b/mixtape/Identity/IdentityBuilderExtensions.cs @@ -1,17 +1,17 @@ using Microsoft.AspNetCore.Identity; using Microsoft.Extensions.DependencyInjection.Extensions; -namespace Finch.Identity; +namespace Mixtape.Identity; public static class IdentityBuilderExtensions { /// /// Adds an implementation of identity information stores. /// - public static IdentityBuilder AddFinchIdentityStores(this IdentityBuilder builder) + public static IdentityBuilder AddMixtapeIdentityStores(this IdentityBuilder builder) { - Type userStoreType = typeof(FinchUserStore<,>).MakeGenericType(builder.UserType, builder.RoleType); - Type roleStoreType = typeof(FinchRoleStore<>).MakeGenericType(builder.RoleType); + Type userStoreType = typeof(MixtapeUserStore<,>).MakeGenericType(builder.UserType, builder.RoleType); + Type roleStoreType = typeof(MixtapeRoleStore<>).MakeGenericType(builder.RoleType); builder.Services.TryAddScoped(typeof(IUserStore<>).MakeGenericType(builder.UserType), userStoreType); builder.Services.TryAddScoped(typeof(IRoleStore<>).MakeGenericType(builder.RoleType), roleStoreType); diff --git a/Finch/Identity/FinchIdentityConstants.cs b/mixtape/Identity/MixtapeIdentityConstants.cs similarity index 82% rename from Finch/Identity/FinchIdentityConstants.cs rename to mixtape/Identity/MixtapeIdentityConstants.cs index 32a956b2..38941a75 100644 --- a/Finch/Identity/FinchIdentityConstants.cs +++ b/mixtape/Identity/MixtapeIdentityConstants.cs @@ -1,13 +1,13 @@ -namespace Finch.Identity; +namespace Mixtape.Identity; /// /// Represents all the options you can use to configure the cookies middleware used by the identity system. /// -public class FinchIdentityConstants +public class MixtapeIdentityConstants { public static class CookieNames { - private const string CookiePrefix = "Finch.id"; + private const string CookiePrefix = "Mixtape.id"; public static readonly string Application = CookiePrefix + ".app"; public static readonly string External = CookiePrefix + ".ext"; @@ -17,9 +17,9 @@ public class FinchIdentityConstants public static partial class Claims { - private const string ClaimPrefix = "Finch.claim"; + private const string ClaimPrefix = "Mixtape.claim"; - public static readonly string IsFinch = ClaimPrefix + ".isfinch"; + public static readonly string IsMixtape = ClaimPrefix + ".ismixtape"; public static readonly string UserId = ClaimPrefix + ".userid"; public static readonly string Username = ClaimPrefix + ".username"; public static readonly string Name = ClaimPrefix + ".name"; diff --git a/Finch/Identity/FinchIdentityExtensions.cs b/mixtape/Identity/MixtapeIdentityExtensions.cs similarity index 78% rename from Finch/Identity/FinchIdentityExtensions.cs rename to mixtape/Identity/MixtapeIdentityExtensions.cs index 65faafb9..40ad89a9 100644 --- a/Finch/Identity/FinchIdentityExtensions.cs +++ b/mixtape/Identity/MixtapeIdentityExtensions.cs @@ -4,9 +4,9 @@ using Microsoft.AspNetCore.Identity; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; -namespace Finch.Identity; +namespace Mixtape.Identity; -public static class FinchIdentityExtensions +public static class MixtapeIdentityExtensions { // /// Adds the default identity system configuration for the specified User and Role types. @@ -15,10 +15,10 @@ public static class FinchIdentityExtensions /// The type representing a Role in the system. /// The services available in the application. /// An for creating and configuring the identity system. - public static IdentityBuilder AddFinchIdentity(this IServiceCollection services) - where TUser : FinchIdentityUser, new() - where TRole : FinchIdentityRole, new() => - AddFinchIdentity(services, null); + public static IdentityBuilder AddMixtapeIdentity(this IServiceCollection services) + where TUser : MixtapeIdentityUser, new() + where TRole : MixtapeIdentityRole, new() => + AddMixtapeIdentity(services, null); /// @@ -29,10 +29,10 @@ public static class FinchIdentityExtensions /// The services available in the application. /// An action to configure the . /// An for creating and configuring the identity system. - public static IdentityBuilder AddFinchIdentity(this IServiceCollection services, + public static IdentityBuilder AddMixtapeIdentity(this IServiceCollection services, Action setupAction) - where TUser : FinchIdentityUser, new() - where TRole : FinchIdentityRole, new() + where TUser : MixtapeIdentityUser, new() + where TRole : MixtapeIdentityRole, new() { // Services identity depends on services @@ -53,7 +53,7 @@ public static class FinchIdentityExtensions o.SlidingExpiration = true; o.ExpireTimeSpan = TimeSpan.FromDays(90); - o.Cookie.Name = FinchIdentityConstants.CookieNames.Application; + o.Cookie.Name = MixtapeIdentityConstants.CookieNames.Application; o.Cookie.HttpOnly = true; o.Cookie.SecurePolicy = CookieSecurePolicy.SameAsRequest; o.Cookie.SameSite = SameSiteMode.Lax; @@ -66,12 +66,12 @@ public static class FinchIdentityExtensions }) .AddCookie(IdentityConstants.ExternalScheme, o => { - o.Cookie.Name = FinchIdentityConstants.CookieNames.External; + o.Cookie.Name = MixtapeIdentityConstants.CookieNames.External; o.ExpireTimeSpan = TimeSpan.FromMinutes(5); }) .AddCookie(IdentityConstants.TwoFactorRememberMeScheme, o => { - o.Cookie.Name = FinchIdentityConstants.CookieNames.TwoFactorRememberMe; + o.Cookie.Name = MixtapeIdentityConstants.CookieNames.TwoFactorRememberMe; o.Events = new CookieAuthenticationEvents { OnValidatePrincipal = SecurityStampValidator.ValidateAsync @@ -79,7 +79,7 @@ public static class FinchIdentityExtensions }) .AddCookie(IdentityConstants.TwoFactorUserIdScheme, o => { - o.Cookie.Name = FinchIdentityConstants.CookieNames.TwoFactorUserId; + o.Cookie.Name = MixtapeIdentityConstants.CookieNames.TwoFactorUserId; o.ExpireTimeSpan = TimeSpan.FromMinutes(5); }); @@ -105,11 +105,11 @@ public static class FinchIdentityExtensions services.Configure(opts => { - opts.ClaimsIdentity.UserIdClaimType = FinchIdentityConstants.Claims.UserId; - opts.ClaimsIdentity.UserNameClaimType = FinchIdentityConstants.Claims.Username; - opts.ClaimsIdentity.RoleClaimType = FinchIdentityConstants.Claims.Role; - opts.ClaimsIdentity.SecurityStampClaimType = FinchIdentityConstants.Claims.SecurityStamp; - opts.ClaimsIdentity.EmailClaimType = FinchIdentityConstants.Claims.Email; + opts.ClaimsIdentity.UserIdClaimType = MixtapeIdentityConstants.Claims.UserId; + opts.ClaimsIdentity.UserNameClaimType = MixtapeIdentityConstants.Claims.Username; + opts.ClaimsIdentity.RoleClaimType = MixtapeIdentityConstants.Claims.Role; + opts.ClaimsIdentity.SecurityStampClaimType = MixtapeIdentityConstants.Claims.SecurityStamp; + opts.ClaimsIdentity.EmailClaimType = MixtapeIdentityConstants.Claims.Email; opts.Password.RequireDigit = false; opts.Password.RequireLowercase = false; @@ -135,7 +135,7 @@ public static class FinchIdentityExtensions IdentityBuilder builder = new(typeof(TUser), typeof(TRole), services); builder.AddDefaultTokenProviders(); - builder.AddFinchIdentityStores(); + builder.AddMixtapeIdentityStores(); return builder; } @@ -147,7 +147,7 @@ public static class FinchIdentityExtensions /// The services available in the application. /// An action to configure the . /// The services. - public static IServiceCollection ConfigureFinchApplicationCookie(this IServiceCollection services, Action configure) + public static IServiceCollection ConfigureMixtapeApplicationCookie(this IServiceCollection services, Action configure) => services.Configure(IdentityConstants.ApplicationScheme, configure); /// @@ -156,6 +156,6 @@ public static class FinchIdentityExtensions /// The services available in the application. /// An action to configure the . /// The services. - public static IServiceCollection ConfigureFinchExternalCookie(this IServiceCollection services, Action configure) + public static IServiceCollection ConfigureMixtapeExternalCookie(this IServiceCollection services, Action configure) => services.Configure(IdentityConstants.ExternalScheme, configure); } \ No newline at end of file diff --git a/Finch/Identity/FinchIdentityStoreDbProvider.cs b/mixtape/Identity/MixtapeIdentityStoreDbProvider.cs similarity index 57% rename from Finch/Identity/FinchIdentityStoreDbProvider.cs rename to mixtape/Identity/MixtapeIdentityStoreDbProvider.cs index efa2af45..62cc82aa 100644 --- a/Finch/Identity/FinchIdentityStoreDbProvider.cs +++ b/mixtape/Identity/MixtapeIdentityStoreDbProvider.cs @@ -1,18 +1,18 @@ using System.Linq.Expressions; -namespace Finch.Identity; +namespace Mixtape.Identity; -public interface IFinchIdentityStoreDbProvider +public interface IMixtapeIdentityStoreDbProvider { - Task Load(string id, CancellationToken ct = default) where T : FinchEntity, new(); + Task Load(string id, CancellationToken ct = default) where T : MixtapeEntity, new(); - Task Find(Expression> expression, CancellationToken ct = default) where T : FinchEntity; + Task Find(Expression> expression, CancellationToken ct = default) where T : MixtapeEntity; - Task> FindAll(Expression> expression, CancellationToken ct = default) where T : FinchEntity; + Task> FindAll(Expression> expression, CancellationToken ct = default) where T : MixtapeEntity; - Task> Create(T model, CancellationToken ct = default) where T : FinchEntity, new(); + Task> Create(T model, CancellationToken ct = default) where T : MixtapeEntity, new(); - Task> Update(T model, CancellationToken ct = default) where T : FinchEntity, new(); + Task> Update(T model, CancellationToken ct = default) where T : MixtapeEntity, new(); - Task> Delete(T model, CancellationToken ct = default) where T : FinchEntity, new(); + Task> Delete(T model, CancellationToken ct = default) where T : MixtapeEntity, new(); } \ No newline at end of file diff --git a/Finch/Identity/FinchRoleStore(TRole).cs b/mixtape/Identity/MixtapeRoleStore(TRole).cs similarity index 91% rename from Finch/Identity/FinchRoleStore(TRole).cs rename to mixtape/Identity/MixtapeRoleStore(TRole).cs index b64d373e..e5b0452c 100644 --- a/Finch/Identity/FinchRoleStore(TRole).cs +++ b/mixtape/Identity/MixtapeRoleStore(TRole).cs @@ -1,19 +1,19 @@ using Microsoft.AspNetCore.Identity; using System.Security.Claims; -namespace Finch.Identity; +namespace Mixtape.Identity; -public class FinchRoleStore : +public class MixtapeRoleStore : IRoleStore, IRoleClaimStore - where TRole : FinchIdentityRole, new() + where TRole : MixtapeIdentityRole, new() { protected IdentityErrorDescriber ErrorDescriber { get; private set; } - protected virtual IFinchIdentityStoreDbProvider Db { get; set; } + protected virtual IMixtapeIdentityStoreDbProvider Db { get; set; } - public FinchRoleStore(IFinchIdentityStoreDbProvider db, IdentityErrorDescriber describer = null) + public MixtapeRoleStore(IMixtapeIdentityStoreDbProvider db, IdentityErrorDescriber describer = null) { Db = db; ErrorDescriber = describer ?? new IdentityErrorDescriber(); @@ -28,7 +28,7 @@ public class FinchRoleStore : foreach (ResultError error in result.Errors) { string message = error.Message + "(key: " + error.Property + ")"; - errors[index++] = new() { Code = "finch/raven/500", Description = message }; + errors[index++] = new() { Code = "mixtape/raven/500", Description = message }; } return IdentityResult.Failed(errors); diff --git a/Finch/Identity/FinchUserStore(TUser).cs b/mixtape/Identity/MixtapeUserStore(TUser).cs similarity index 97% rename from Finch/Identity/FinchUserStore(TUser).cs rename to mixtape/Identity/MixtapeUserStore(TUser).cs index 77be3393..5b2bdbd0 100644 --- a/Finch/Identity/FinchUserStore(TUser).cs +++ b/mixtape/Identity/MixtapeUserStore(TUser).cs @@ -1,10 +1,10 @@ using Microsoft.AspNetCore.Identity; using System.Security.Claims; -namespace Finch.Identity; +namespace Mixtape.Identity; -public partial class FinchUserStore : +public partial class MixtapeUserStore : IUserStore, IUserEmailStore, IUserLockoutStore, @@ -17,9 +17,9 @@ public partial class FinchUserStore : IUserTwoFactorStore, IUserTwoFactorRecoveryCodeStore, IUserPhoneNumberStore - where TUser : FinchIdentityUser, new() + where TUser : MixtapeIdentityUser, new() { - public FinchUserStore(IFinchIdentityStoreDbProvider db, IdentityErrorDescriber describer = null) + public MixtapeUserStore(IMixtapeIdentityStoreDbProvider db, IdentityErrorDescriber describer = null) { Db = db; ErrorDescriber = describer ?? new IdentityErrorDescriber(); @@ -29,7 +29,7 @@ public partial class FinchUserStore : protected IdentityErrorDescriber ErrorDescriber { get; private set; } - protected virtual IFinchIdentityStoreDbProvider Db { get; set; } + protected virtual IMixtapeIdentityStoreDbProvider Db { get; set; } private IdentityResult Fail(Result result) { @@ -39,7 +39,7 @@ public partial class FinchUserStore : foreach (ResultError error in result.Errors) { string message = error.Message + "(key: " + error.Property + ")"; - errors[index++] = new() { Code = "finch/raven/500", Description = message }; + errors[index++] = new() { Code = "mixtape/raven/500", Description = message }; } return IdentityResult.Failed(errors); diff --git a/Finch/Identity/FinchUserStore(TUser,TRole).cs b/mixtape/Identity/MixtapeUserStore(TUser,TRole).cs similarity index 80% rename from Finch/Identity/FinchUserStore(TUser,TRole).cs rename to mixtape/Identity/MixtapeUserStore(TUser,TRole).cs index 17fd976e..18f417c6 100644 --- a/Finch/Identity/FinchUserStore(TUser,TRole).cs +++ b/mixtape/Identity/MixtapeUserStore(TUser,TRole).cs @@ -1,13 +1,13 @@ using Microsoft.AspNetCore.Identity; -namespace Finch.Identity; +namespace Mixtape.Identity; -public partial class FinchUserStore : FinchUserStore, +public partial class MixtapeUserStore : MixtapeUserStore, IUserRoleStore - where TUser : FinchIdentityUser, new() - where TRole : FinchIdentityRole, new() + where TUser : MixtapeIdentityUser, new() + where TRole : MixtapeIdentityRole, new() { - public FinchUserStore(IFinchIdentityStoreDbProvider db) : base(db) { } + public MixtapeUserStore(IMixtapeIdentityStoreDbProvider db) : base(db) { } /// diff --git a/Finch/Identity/Models/FinchIdentityRole.cs b/mixtape/Identity/Models/MixtapeIdentityRole.cs similarity index 63% rename from Finch/Identity/Models/FinchIdentityRole.cs rename to mixtape/Identity/Models/MixtapeIdentityRole.cs index 0d3f2dd8..69680f69 100644 --- a/Finch/Identity/Models/FinchIdentityRole.cs +++ b/mixtape/Identity/Models/MixtapeIdentityRole.cs @@ -1,6 +1,6 @@ -namespace Finch.Identity; +namespace Mixtape.Identity; -public abstract class FinchIdentityRole : FinchEntity +public abstract class MixtapeIdentityRole : MixtapeEntity { /// /// The role's claims, for use in claims-based authentication. diff --git a/Finch/Identity/Models/FinchIdentityUser.cs b/mixtape/Identity/Models/MixtapeIdentityUser.cs similarity index 96% rename from Finch/Identity/Models/FinchIdentityUser.cs rename to mixtape/Identity/Models/MixtapeIdentityUser.cs index 5769e20e..01d9d473 100644 --- a/Finch/Identity/Models/FinchIdentityUser.cs +++ b/mixtape/Identity/Models/MixtapeIdentityUser.cs @@ -1,8 +1,8 @@ using Microsoft.AspNetCore.Identity; -namespace Finch.Identity; +namespace Mixtape.Identity; -public abstract class FinchIdentityUser : FinchEntity +public abstract class MixtapeIdentityUser : MixtapeEntity { /// /// Optional username (can also be used as login when configured) diff --git a/Finch/Identity/Models/TwoFactorKey.cs b/mixtape/Identity/Models/TwoFactorKey.cs similarity index 94% rename from Finch/Identity/Models/TwoFactorKey.cs rename to mixtape/Identity/Models/TwoFactorKey.cs index 6b94a376..1b0cd4ec 100644 --- a/Finch/Identity/Models/TwoFactorKey.cs +++ b/mixtape/Identity/Models/TwoFactorKey.cs @@ -1,6 +1,6 @@ -using Finch.Rendering.QrCode; +using Mixtape.Rendering.QrCode; -namespace Finch.Identity; +namespace Mixtape.Identity; public class TwoFactorKey { diff --git a/Finch/Identity/Models/UserClaim.cs b/mixtape/Identity/Models/UserClaim.cs similarity index 96% rename from Finch/Identity/Models/UserClaim.cs rename to mixtape/Identity/Models/UserClaim.cs index 9c1d33cd..9b472e64 100644 --- a/Finch/Identity/Models/UserClaim.cs +++ b/mixtape/Identity/Models/UserClaim.cs @@ -1,6 +1,6 @@ using System.Security.Claims; -namespace Finch.Identity; +namespace Mixtape.Identity; public class UserClaim { diff --git a/Finch/Identity/Models/UserClaimComparer.cs b/mixtape/Identity/Models/UserClaimComparer.cs similarity index 92% rename from Finch/Identity/Models/UserClaimComparer.cs rename to mixtape/Identity/Models/UserClaimComparer.cs index 8f6815e6..b8751617 100644 --- a/Finch/Identity/Models/UserClaimComparer.cs +++ b/mixtape/Identity/Models/UserClaimComparer.cs @@ -1,4 +1,4 @@ -namespace Finch.Identity; +namespace Mixtape.Identity; public class UserClaimComparer : IEqualityComparer { diff --git a/Finch/Identity/Models/UserExternalLogin.cs b/mixtape/Identity/Models/UserExternalLogin.cs similarity index 96% rename from Finch/Identity/Models/UserExternalLogin.cs rename to mixtape/Identity/Models/UserExternalLogin.cs index 3ea1c068..12e84488 100644 --- a/Finch/Identity/Models/UserExternalLogin.cs +++ b/mixtape/Identity/Models/UserExternalLogin.cs @@ -1,6 +1,6 @@ using Microsoft.AspNetCore.Identity; -namespace Finch.Identity; +namespace Mixtape.Identity; public class UserExternalLogin { diff --git a/Finch/Identity/Models/UserToken.cs b/mixtape/Identity/Models/UserToken.cs similarity index 91% rename from Finch/Identity/Models/UserToken.cs rename to mixtape/Identity/Models/UserToken.cs index 06a12407..2c08fbef 100644 --- a/Finch/Identity/Models/UserToken.cs +++ b/mixtape/Identity/Models/UserToken.cs @@ -1,4 +1,4 @@ -namespace Finch.Identity; +namespace Mixtape.Identity; public class UserToken { diff --git a/Finch/Identity/UserManagerExtensions.cs b/mixtape/Identity/UserManagerExtensions.cs similarity index 98% rename from Finch/Identity/UserManagerExtensions.cs rename to mixtape/Identity/UserManagerExtensions.cs index 7491159f..2f2bef5d 100644 --- a/Finch/Identity/UserManagerExtensions.cs +++ b/mixtape/Identity/UserManagerExtensions.cs @@ -2,9 +2,9 @@ using System.Text; using System.Text.Encodings.Web; using Microsoft.AspNetCore.Identity; -using Finch.Rendering.QrCode; +using Mixtape.Rendering.QrCode; -namespace Finch.Identity; +namespace Mixtape.Identity; public static class UserManagerExtensions { diff --git a/Finch/Localization/ConfigurationLocalizer.cs b/mixtape/Localization/ConfigurationLocalizer.cs similarity index 86% rename from Finch/Localization/ConfigurationLocalizer.cs rename to mixtape/Localization/ConfigurationLocalizer.cs index 94e98315..02b4efc1 100644 --- a/Finch/Localization/ConfigurationLocalizer.cs +++ b/mixtape/Localization/ConfigurationLocalizer.cs @@ -2,7 +2,7 @@ using Microsoft.Extensions.Options; using System.Collections.Concurrent; -namespace Finch.Localization; +namespace Mixtape.Localization; public class ConfigurationLocalizer : Localizer { @@ -11,7 +11,7 @@ public class ConfigurationLocalizer : Localizer public ConfigurationLocalizer(IConfiguration configuration, ICultureResolver cultureResolver, IOptionsMonitor options) : base(cultureResolver) { - IConfigurationSection section = configuration.GetSection($"Finch:Localization:{LanguageCode}"); + IConfigurationSection section = configuration.GetSection($"Mixtape:Localization:{LanguageCode}"); if (section != null) { diff --git a/Finch/Localization/CultureChangeMessage.cs b/mixtape/Localization/CultureChangeMessage.cs similarity index 79% rename from Finch/Localization/CultureChangeMessage.cs rename to mixtape/Localization/CultureChangeMessage.cs index 7fb0bc85..0d26a550 100644 --- a/Finch/Localization/CultureChangeMessage.cs +++ b/mixtape/Localization/CultureChangeMessage.cs @@ -1,6 +1,6 @@ using System.Globalization; -namespace Finch.Localization; +namespace Mixtape.Localization; public class CultureChangeMessage : IMessage { diff --git a/Finch/Localization/CultureResolver.cs b/mixtape/Localization/CultureResolver.cs similarity index 94% rename from Finch/Localization/CultureResolver.cs rename to mixtape/Localization/CultureResolver.cs index 0c45d86b..443b2ad6 100644 --- a/Finch/Localization/CultureResolver.cs +++ b/mixtape/Localization/CultureResolver.cs @@ -3,7 +3,7 @@ using Microsoft.Extensions.Logging; using System.Globalization; using System.Linq.Expressions; -namespace Finch.Localization; +namespace Mixtape.Localization; public class CultureResolver : ICultureResolver { @@ -23,7 +23,7 @@ public class CultureResolver : ICultureResolver /// - public Task Resolve(IFinchContext context) + public Task Resolve(IMixtapeContext context) { if (!TryConvert(context.Options.Language, out CultureInfo culture)) { @@ -96,7 +96,7 @@ public interface ICultureResolver /// Resolves the current application from either the backoffice user (in case it is backoffice request) /// or the domain (in case it is frontend request). /// - Task Resolve(IFinchContext context); + Task Resolve(IMixtapeContext context); /// /// Tries to convert an ISO code to a culture diff --git a/Finch/Localization/CultureService.cs b/mixtape/Localization/CultureService.cs similarity index 95% rename from Finch/Localization/CultureService.cs rename to mixtape/Localization/CultureService.cs index e7250713..f014e78a 100644 --- a/Finch/Localization/CultureService.cs +++ b/mixtape/Localization/CultureService.cs @@ -1,6 +1,6 @@ using System.Globalization; -namespace Finch.Localization; +namespace Mixtape.Localization; public class CultureService : ICultureService { diff --git a/Finch/Localization/LocalizationOptions.cs b/mixtape/Localization/LocalizationOptions.cs similarity index 68% rename from Finch/Localization/LocalizationOptions.cs rename to mixtape/Localization/LocalizationOptions.cs index 73995c48..88f80b59 100644 --- a/Finch/Localization/LocalizationOptions.cs +++ b/mixtape/Localization/LocalizationOptions.cs @@ -1,4 +1,4 @@ -namespace Finch.Localization; +namespace Mixtape.Localization; public class LocalizationOptions { diff --git a/Finch/Localization/LocalizeAttribute.cs b/mixtape/Localization/LocalizeAttribute.cs similarity index 86% rename from Finch/Localization/LocalizeAttribute.cs rename to mixtape/Localization/LocalizeAttribute.cs index 6438578c..a86d90bc 100644 --- a/Finch/Localization/LocalizeAttribute.cs +++ b/mixtape/Localization/LocalizeAttribute.cs @@ -1,4 +1,4 @@ -namespace Finch.Localization; +namespace Mixtape.Localization; [AttributeUsage(AttributeTargets.Class | AttributeTargets.Field, AllowMultiple = false)] public class LocalizeAttribute : Attribute diff --git a/Finch/Localization/Localizer.cs b/mixtape/Localization/Localizer.cs similarity index 98% rename from Finch/Localization/Localizer.cs rename to mixtape/Localization/Localizer.cs index 0e6b7b0d..ff05273e 100644 --- a/Finch/Localization/Localizer.cs +++ b/mixtape/Localization/Localizer.cs @@ -2,7 +2,7 @@ using System.Globalization; using System.Reflection; -namespace Finch.Localization; +namespace Mixtape.Localization; public abstract class Localizer : ILocalizer { diff --git a/Finch/Localization/LocalizerExtensions.cs b/mixtape/Localization/LocalizerExtensions.cs similarity index 96% rename from Finch/Localization/LocalizerExtensions.cs rename to mixtape/Localization/LocalizerExtensions.cs index b721f1d1..d64c853b 100644 --- a/Finch/Localization/LocalizerExtensions.cs +++ b/mixtape/Localization/LocalizerExtensions.cs @@ -1,6 +1,6 @@ using Microsoft.AspNetCore.Html; -namespace Finch.Localization; +namespace Mixtape.Localization; public static class LocalizerExtensions { diff --git a/Finch/Localization/FinchLocalizationModule.cs b/mixtape/Localization/MixtapeLocalizationModule.cs similarity index 89% rename from Finch/Localization/FinchLocalizationModule.cs rename to mixtape/Localization/MixtapeLocalizationModule.cs index 7c3e416d..614e0696 100644 --- a/Finch/Localization/FinchLocalizationModule.cs +++ b/mixtape/Localization/MixtapeLocalizationModule.cs @@ -4,9 +4,9 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Localization; -namespace Finch.Localization; +namespace Mixtape.Localization; -internal class FinchLocalizationModule : FinchModule +internal class MixtapeLocalizationModule : MixtapeModule { public override void ConfigureServices(IServiceCollection services, IConfiguration configuration) { @@ -25,7 +25,7 @@ internal class FinchLocalizationModule : FinchModule services.AddLocalization(); - services.AddOptions().Bind(configuration.GetSection("Finch:Localization")).Configure(opts => + services.AddOptions().Bind(configuration.GetSection("Mixtape:Localization")).Configure(opts => { opts.FilePath = "Config/texts.json"; }); diff --git a/Finch/Localization/Models/Culture.cs b/mixtape/Localization/Models/Culture.cs similarity index 73% rename from Finch/Localization/Models/Culture.cs rename to mixtape/Localization/Models/Culture.cs index cd5cd990..14297446 100644 --- a/Finch/Localization/Models/Culture.cs +++ b/mixtape/Localization/Models/Culture.cs @@ -1,4 +1,4 @@ -namespace Finch.Localization; +namespace Mixtape.Localization; public class Culture { diff --git a/Finch/Localization/Models/Translation.cs b/mixtape/Localization/Models/Translation.cs similarity index 91% rename from Finch/Localization/Models/Translation.cs rename to mixtape/Localization/Models/Translation.cs index aa5a95fc..c86d0a57 100644 --- a/Finch/Localization/Models/Translation.cs +++ b/mixtape/Localization/Models/Translation.cs @@ -1,4 +1,4 @@ -namespace Finch.Localization; +namespace Mixtape.Localization; public record Translation { diff --git a/Finch/Localization/StringLocalizer.cs b/mixtape/Localization/StringLocalizer.cs similarity index 97% rename from Finch/Localization/StringLocalizer.cs rename to mixtape/Localization/StringLocalizer.cs index 6847a485..2e3fe269 100644 --- a/Finch/Localization/StringLocalizer.cs +++ b/mixtape/Localization/StringLocalizer.cs @@ -1,7 +1,7 @@ using System.Globalization; using Microsoft.Extensions.Localization; -namespace Finch.Localization; +namespace Mixtape.Localization; public class StringLocalizer : StringLocalizer, IStringLocalizer { diff --git a/Finch/Logging/AnalyticsController.cs b/mixtape/Logging/AnalyticsController.cs similarity index 97% rename from Finch/Logging/AnalyticsController.cs rename to mixtape/Logging/AnalyticsController.cs index 010f38fc..2a57e84b 100644 --- a/Finch/Logging/AnalyticsController.cs +++ b/mixtape/Logging/AnalyticsController.cs @@ -1,16 +1,16 @@ using System.Net.Http; using Microsoft.AspNetCore.Mvc; -using Finch.Mvc; +using Mixtape.Mvc; using Microsoft.Extensions.Caching.Memory; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Microsoft.Extensions.Primitives; -namespace Finch.Logging; +namespace Mixtape.Logging; [ApiController] [Route("/api/hello")] -public class AnalyticsController : FinchController +public class AnalyticsController : MixtapeController { protected IOptionsMonitor Options { get; } protected ILogger Logger { get; } diff --git a/Finch/Logging/AnalyticsOptions.cs b/mixtape/Logging/AnalyticsOptions.cs similarity index 93% rename from Finch/Logging/AnalyticsOptions.cs rename to mixtape/Logging/AnalyticsOptions.cs index 173775ca..14d4f0f1 100644 --- a/Finch/Logging/AnalyticsOptions.cs +++ b/mixtape/Logging/AnalyticsOptions.cs @@ -1,4 +1,4 @@ -namespace Finch.Logging; +namespace Mixtape.Logging; public class AnalyticsOptions { diff --git a/Finch/Logging/AnalyticsTrackerTagHelper.cs b/mixtape/Logging/AnalyticsTrackerTagHelper.cs similarity index 95% rename from Finch/Logging/AnalyticsTrackerTagHelper.cs rename to mixtape/Logging/AnalyticsTrackerTagHelper.cs index b7f636bc..7ea7bde7 100644 --- a/Finch/Logging/AnalyticsTrackerTagHelper.cs +++ b/mixtape/Logging/AnalyticsTrackerTagHelper.cs @@ -1,11 +1,11 @@ -using Finch.Logging; +using Mixtape.Logging; using Microsoft.AspNetCore.Mvc.Rendering; using Microsoft.AspNetCore.Mvc.ViewFeatures; using Microsoft.AspNetCore.Razor.TagHelpers; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Options; -namespace Finch.TagHelpers; +namespace Mixtape.TagHelpers; [HtmlTargetElement("app-tracker", TagStructure = TagStructure.NormalOrSelfClosing)] public class AnalyticsTrackerTagHelper(IOptionsMonitor options, IHostEnvironment env) : TagHelper diff --git a/Finch/Logging/LogLevelOverrides.cs b/mixtape/Logging/LogLevelOverrides.cs similarity index 74% rename from Finch/Logging/LogLevelOverrides.cs rename to mixtape/Logging/LogLevelOverrides.cs index 81d74d41..9998beb9 100644 --- a/Finch/Logging/LogLevelOverrides.cs +++ b/mixtape/Logging/LogLevelOverrides.cs @@ -1,23 +1,23 @@ using System.Reflection; using Microsoft.Extensions.Logging; -namespace Finch.Logging; +namespace Mixtape.Logging; public class LogLevelOverrides : Dictionary { public LogLevelOverrides()//IHostEnvironment env) { - this["Finch"] = LogLevel.Debug; - this["Finch.Routing"] = LogLevel.Debug; + this["Mixtape"] = LogLevel.Debug; + this["Mixtape.Routing"] = LogLevel.Debug; // if (env.IsDevelopment()) // { - // this["Finch"] = LogLevel.Debug; - // this["Finch.Routing"] = LogLevel.Debug; + // this["Mixtape"] = LogLevel.Debug; + // this["Mixtape.Routing"] = LogLevel.Debug; // } // else // { - // this["Finch"] = LogLevel.Debug; + // this["Mixtape"] = LogLevel.Debug; // } this["SixLabors"] = LogLevel.Warning; diff --git a/Finch/Logging/FinchLoggingModule.cs b/mixtape/Logging/MixtapeLoggingModule.cs similarity index 79% rename from Finch/Logging/FinchLoggingModule.cs rename to mixtape/Logging/MixtapeLoggingModule.cs index 50b4abbe..1327f10b 100644 --- a/Finch/Logging/FinchLoggingModule.cs +++ b/mixtape/Logging/MixtapeLoggingModule.cs @@ -2,9 +2,9 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; -namespace Finch.Logging; +namespace Mixtape.Logging; -public class FinchLoggingModule : FinchModule +public class MixtapeLoggingModule : MixtapeModule { public override int Order { get; } = -100; @@ -12,18 +12,18 @@ public class FinchLoggingModule : FinchModule public override void ConfigureServices(IServiceCollection services, IConfiguration configuration) { services.AddHttpClient().RemoveAllLoggers(); - services.AddOptions().Bind(configuration.GetSection("Finch:Analytics")); + services.AddOptions().Bind(configuration.GetSection("Mixtape:Analytics")); services.AddLogging(builder => { // get seq configuration - IConfigurationSection seqConfig = configuration.GetSection("Finch:Seq"); - FinchSeqOptions seqOptions = seqConfig.Get() ?? new(); + IConfigurationSection seqConfig = configuration.GetSection("Mixtape:Seq"); + MixtapeSeqOptions seqOptions = seqConfig.Get() ?? new(); // default level builder.SetMinimumLevel(seqOptions.MinimumLevel); - // apply log level overrides from finch + // apply log level overrides from mixtape foreach (KeyValuePair levelOverride in seqOptions.LevelOverrides) { builder.AddFilter(levelOverride.Key, levelOverride.Value); diff --git a/Finch/Logging/FinchSeqOptions.cs b/mixtape/Logging/MixtapeSeqOptions.cs similarity index 93% rename from Finch/Logging/FinchSeqOptions.cs rename to mixtape/Logging/MixtapeSeqOptions.cs index 82d7ea1d..1c87160c 100644 --- a/Finch/Logging/FinchSeqOptions.cs +++ b/mixtape/Logging/MixtapeSeqOptions.cs @@ -1,9 +1,9 @@ using Microsoft.Extensions.Logging; using Seq.Extensions.Logging; -namespace Finch.Logging; +namespace Mixtape.Logging; -public class FinchSeqOptions +public class MixtapeSeqOptions { /// /// URL to the Seq server diff --git a/Finch/Mails/Dispatchers/FileMailDispatcher.cs b/mixtape/Mails/Dispatchers/FileMailDispatcher.cs similarity index 98% rename from Finch/Mails/Dispatchers/FileMailDispatcher.cs rename to mixtape/Mails/Dispatchers/FileMailDispatcher.cs index 51d0cd25..088c293f 100644 --- a/Finch/Mails/Dispatchers/FileMailDispatcher.cs +++ b/mixtape/Mails/Dispatchers/FileMailDispatcher.cs @@ -1,7 +1,7 @@ //using System.IO; //using System.Text; -//namespace Finch.Mails; +//namespace Mixtape.Mails; ///// ///// Default implementation of an IMailSender which sends the mail a flat file diff --git a/Finch/Mails/Dispatchers/IMailDispatcher.cs b/mixtape/Mails/Dispatchers/IMailDispatcher.cs similarity index 90% rename from Finch/Mails/Dispatchers/IMailDispatcher.cs rename to mixtape/Mails/Dispatchers/IMailDispatcher.cs index f6b61164..0c1aba59 100644 --- a/Finch/Mails/Dispatchers/IMailDispatcher.cs +++ b/mixtape/Mails/Dispatchers/IMailDispatcher.cs @@ -1,4 +1,4 @@ -namespace Finch.Mails.Dispatchers; +namespace Mixtape.Mails.Dispatchers; public interface IMailDispatcher : IDisposable { diff --git a/Finch/Mails/Dispatchers/LoggerMailDispatcher.cs b/mixtape/Mails/Dispatchers/LoggerMailDispatcher.cs similarity index 94% rename from Finch/Mails/Dispatchers/LoggerMailDispatcher.cs rename to mixtape/Mails/Dispatchers/LoggerMailDispatcher.cs index 1696566b..1297ba82 100644 --- a/Finch/Mails/Dispatchers/LoggerMailDispatcher.cs +++ b/mixtape/Mails/Dispatchers/LoggerMailDispatcher.cs @@ -1,6 +1,6 @@ using Microsoft.Extensions.Logging; -namespace Finch.Mails.Dispatchers; +namespace Mixtape.Mails.Dispatchers; /// /// Default implementation of an IMailSender which sends the mail to the attached logger diff --git a/Finch/Mails/Dispatchers/Postmark/PostmarkDispatcher.cs b/mixtape/Mails/Dispatchers/Postmark/PostmarkDispatcher.cs similarity index 98% rename from Finch/Mails/Dispatchers/Postmark/PostmarkDispatcher.cs rename to mixtape/Mails/Dispatchers/Postmark/PostmarkDispatcher.cs index 175a7ebe..106f287e 100644 --- a/Finch/Mails/Dispatchers/Postmark/PostmarkDispatcher.cs +++ b/mixtape/Mails/Dispatchers/Postmark/PostmarkDispatcher.cs @@ -4,7 +4,7 @@ using Microsoft.Extensions.Options; using PostmarkDotNet; using PostmarkDotNet.Model; -namespace Finch.Mails.Dispatchers.Postmark; +namespace Mixtape.Mails.Dispatchers.Postmark; public class PostmarkDispatcher : IMailDispatcher { diff --git a/Finch/Mails/Dispatchers/Postmark/PostmarkOptions.cs b/mixtape/Mails/Dispatchers/Postmark/PostmarkOptions.cs similarity index 78% rename from Finch/Mails/Dispatchers/Postmark/PostmarkOptions.cs rename to mixtape/Mails/Dispatchers/Postmark/PostmarkOptions.cs index c35bfe0a..1c44f6e3 100644 --- a/Finch/Mails/Dispatchers/Postmark/PostmarkOptions.cs +++ b/mixtape/Mails/Dispatchers/Postmark/PostmarkOptions.cs @@ -1,4 +1,4 @@ -namespace Finch.Mails.Dispatchers.Postmark; +namespace Mixtape.Mails.Dispatchers.Postmark; public class PostmarkOptions { diff --git a/Finch/Mails/Dispatchers/Scaleway/ScalewayDispatcher.cs b/mixtape/Mails/Dispatchers/Scaleway/ScalewayDispatcher.cs similarity index 99% rename from Finch/Mails/Dispatchers/Scaleway/ScalewayDispatcher.cs rename to mixtape/Mails/Dispatchers/Scaleway/ScalewayDispatcher.cs index a0e40255..62ad9410 100644 --- a/Finch/Mails/Dispatchers/Scaleway/ScalewayDispatcher.cs +++ b/mixtape/Mails/Dispatchers/Scaleway/ScalewayDispatcher.cs @@ -9,7 +9,7 @@ using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Attachment = System.Net.Mail.Attachment; -namespace Finch.Mails.Dispatchers.Scaleway; +namespace Mixtape.Mails.Dispatchers.Scaleway; public class ScalewayDispatcher : IMailDispatcher { diff --git a/Finch/Mails/Dispatchers/Scaleway/ScalewayOptions.cs b/mixtape/Mails/Dispatchers/Scaleway/ScalewayOptions.cs similarity index 82% rename from Finch/Mails/Dispatchers/Scaleway/ScalewayOptions.cs rename to mixtape/Mails/Dispatchers/Scaleway/ScalewayOptions.cs index 99690314..8b2b2a19 100644 --- a/Finch/Mails/Dispatchers/Scaleway/ScalewayOptions.cs +++ b/mixtape/Mails/Dispatchers/Scaleway/ScalewayOptions.cs @@ -1,4 +1,4 @@ -namespace Finch.Mails.Dispatchers.Scaleway; +namespace Mixtape.Mails.Dispatchers.Scaleway; public class ScalewayOptions { diff --git a/Finch/Mails/Dispatchers/Scaleway/ScalewayRequest.cs b/mixtape/Mails/Dispatchers/Scaleway/ScalewayRequest.cs similarity index 96% rename from Finch/Mails/Dispatchers/Scaleway/ScalewayRequest.cs rename to mixtape/Mails/Dispatchers/Scaleway/ScalewayRequest.cs index 0aa91f1f..17ee134e 100644 --- a/Finch/Mails/Dispatchers/Scaleway/ScalewayRequest.cs +++ b/mixtape/Mails/Dispatchers/Scaleway/ScalewayRequest.cs @@ -1,6 +1,6 @@ using System.Text.Json.Serialization; -namespace Finch.Mails.Dispatchers.Scaleway; +namespace Mixtape.Mails.Dispatchers.Scaleway; public class ScalewayRequest { diff --git a/Finch/Mails/Dispatchers/Scaleway/ScalewayResponse.cs b/mixtape/Mails/Dispatchers/Scaleway/ScalewayResponse.cs similarity index 94% rename from Finch/Mails/Dispatchers/Scaleway/ScalewayResponse.cs rename to mixtape/Mails/Dispatchers/Scaleway/ScalewayResponse.cs index 8a3642fd..89d6e4d1 100644 --- a/Finch/Mails/Dispatchers/Scaleway/ScalewayResponse.cs +++ b/mixtape/Mails/Dispatchers/Scaleway/ScalewayResponse.cs @@ -1,4 +1,4 @@ -namespace Finch.Mails.Dispatchers.Scaleway; +namespace Mixtape.Mails.Dispatchers.Scaleway; public class ScalewayResponse { diff --git a/Finch/Mails/Mail.cs b/mixtape/Mails/Mail.cs similarity index 98% rename from Finch/Mails/Mail.cs rename to mixtape/Mails/Mail.cs index 595fdc6d..25726b9d 100644 --- a/Finch/Mails/Mail.cs +++ b/mixtape/Mails/Mail.cs @@ -1,7 +1,7 @@ using System.Net.Mail; using System.Text; -namespace Finch.Mails; +namespace Mixtape.Mails; public class Mail : Mail where T : class { diff --git a/Finch/Mails/MailOptions.cs b/mixtape/Mails/MailOptions.cs similarity index 81% rename from Finch/Mails/MailOptions.cs rename to mixtape/Mails/MailOptions.cs index 0700725a..d4fe66b3 100644 --- a/Finch/Mails/MailOptions.cs +++ b/mixtape/Mails/MailOptions.cs @@ -1,7 +1,7 @@ -using Finch.Mails.Dispatchers.Postmark; -using Finch.Mails.Dispatchers.Scaleway; +using Mixtape.Mails.Dispatchers.Postmark; +using Mixtape.Mails.Dispatchers.Scaleway; -namespace Finch.Mails; +namespace Mixtape.Mails; public class MailOptions { diff --git a/Finch/Mails/MailProvider.cs b/mixtape/Mails/MailProvider.cs similarity index 87% rename from Finch/Mails/MailProvider.cs rename to mixtape/Mails/MailProvider.cs index 728fe687..722bab61 100644 --- a/Finch/Mails/MailProvider.cs +++ b/mixtape/Mails/MailProvider.cs @@ -2,16 +2,16 @@ using System.Net.Mail; using System.Reflection; using System.Text; -using Finch.Mails.Dispatchers; +using Mixtape.Mails.Dispatchers; using Microsoft.Extensions.Options; -namespace Finch.Mails; +namespace Mixtape.Mails; -public class MailProvider(IFinchContext finch, IOptionsMonitor mailOptions, ILogger logger, IMailDispatcher mailDispatcher, IRazorRenderer renderer) : IMailProvider +public class MailProvider(IMixtapeContext mixtape, IOptionsMonitor mailOptions, ILogger logger, IMailDispatcher mailDispatcher, IRazorRenderer renderer) : IMailProvider { protected ILogger Logger { get; set; } = logger; - protected IFinchContext Finch { get; set; } = finch; + protected IMixtapeContext Mixtape { get; set; } = mixtape; protected IMailDispatcher Dispatcher { get; set; } = mailDispatcher; @@ -68,7 +68,7 @@ public class MailProvider(IFinchContext finch, IOptionsMonitor mail message.BodyEncoding = _encoding; message.Preheader = TokenReplacement.Apply(message.Preheader, message.Placeholders); - string appName = Finch.Options.AppName.Or(Assembly.GetEntryAssembly()?.GetName().Name); + string appName = Mixtape.Options.AppName.Or(Assembly.GetEntryAssembly()?.GetName().Name); message.Metadata.Add("application", appName); if (!message.HasView || message.Body.HasValue()) diff --git a/Finch/Mails/FinchMailModule.cs b/mixtape/Mails/MixtapeMailModule.cs similarity index 74% rename from Finch/Mails/FinchMailModule.cs rename to mixtape/Mails/MixtapeMailModule.cs index 63bdfaa4..f970e8cb 100644 --- a/Finch/Mails/FinchMailModule.cs +++ b/mixtape/Mails/MixtapeMailModule.cs @@ -1,12 +1,12 @@ -using Finch.Mails.Dispatchers; -using Finch.Mails.Dispatchers.Postmark; -using Finch.Mails.Dispatchers.Scaleway; +using Mixtape.Mails.Dispatchers; +using Mixtape.Mails.Dispatchers.Postmark; +using Mixtape.Mails.Dispatchers.Scaleway; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; -namespace Finch.Mails; +namespace Mixtape.Mails; -internal class FinchMailModule : FinchModule +internal class MixtapeMailModule : MixtapeModule { public override void ConfigureServices(IServiceCollection services, IConfiguration configuration) { @@ -17,7 +17,7 @@ internal class FinchMailModule : FinchModule // to use other dispatchers .AddMailDispatcher() should be used services.AddScoped(); - services.AddOptions().Bind(configuration.GetSection("Finch:Mails")).Configure(opts => + services.AddOptions().Bind(configuration.GetSection("Mixtape:Mails")).Configure(opts => { opts.BuildViewPath = mail => $"~/Mails/{mail.ViewKey.Replace('.', '/')}.cshtml"; }); diff --git a/Finch/Mails/ServiceCollectionExtensions.cs b/mixtape/Mails/ServiceCollectionExtensions.cs similarity index 87% rename from Finch/Mails/ServiceCollectionExtensions.cs rename to mixtape/Mails/ServiceCollectionExtensions.cs index 6e1b6fde..8c82835c 100644 --- a/Finch/Mails/ServiceCollectionExtensions.cs +++ b/mixtape/Mails/ServiceCollectionExtensions.cs @@ -1,7 +1,7 @@ -using Finch.Mails.Dispatchers; +using Mixtape.Mails.Dispatchers; using Microsoft.Extensions.DependencyInjection; -namespace Finch.Mails; +namespace Mixtape.Mails; public static class MailsServiceCollectionExtensions { diff --git a/Finch/Media/IFinchMediaStoreDbProvider.cs b/mixtape/Media/IMixtapeMediaStoreDbProvider.cs similarity index 61% rename from Finch/Media/IFinchMediaStoreDbProvider.cs rename to mixtape/Media/IMixtapeMediaStoreDbProvider.cs index 22533022..444d3b6c 100644 --- a/Finch/Media/IFinchMediaStoreDbProvider.cs +++ b/mixtape/Media/IMixtapeMediaStoreDbProvider.cs @@ -1,44 +1,44 @@ using System.Linq.Expressions; -namespace Finch.Media; +namespace Mixtape.Media; -public interface IFinchMediaStoreDbProvider +public interface IMixtapeMediaStoreDbProvider { - Task Find(Expression> expression, CancellationToken ct = default) where T : FinchEntity; + Task Find(Expression> expression, CancellationToken ct = default) where T : MixtapeEntity; - Task> FindAll(Expression> expression, CancellationToken ct = default) where T : FinchEntity; + Task> FindAll(Expression> expression, CancellationToken ct = default) where T : MixtapeEntity; - Task> Create(T model, CancellationToken ct = default) where T : FinchEntity, new(); + Task> Create(T model, CancellationToken ct = default) where T : MixtapeEntity, new(); - Task> Update(T model, CancellationToken ct = default) where T : FinchEntity, new(); + Task> Update(T model, CancellationToken ct = default) where T : MixtapeEntity, new(); - Task> Delete(T model, CancellationToken ct = default) where T : FinchEntity, new(); + Task> Delete(T model, CancellationToken ct = default) where T : MixtapeEntity, new(); } -public class EmptyFinchMediaStoreDbProvider : IFinchMediaStoreDbProvider +public class EmptyMixtapeMediaStoreDbProvider : IMixtapeMediaStoreDbProvider { - public Task> Create(T model, CancellationToken ct = default) where T : FinchEntity, new() + public Task> Create(T model, CancellationToken ct = default) where T : MixtapeEntity, new() { throw new NotImplementedException(); } - public Task> Delete(T model, CancellationToken ct = default) where T : FinchEntity, new() + public Task> Delete(T model, CancellationToken ct = default) where T : MixtapeEntity, new() { throw new NotImplementedException(); } - public Task Find(Expression> expression, CancellationToken ct = default) where T : FinchEntity + public Task Find(Expression> expression, CancellationToken ct = default) where T : MixtapeEntity { throw new NotImplementedException(); } - public Task> FindAll(Expression> expression, CancellationToken ct = default) where T : FinchEntity + public Task> FindAll(Expression> expression, CancellationToken ct = default) where T : MixtapeEntity { throw new NotImplementedException(); } - public Task> Update(T model, CancellationToken ct = default) where T : FinchEntity, new() + public Task> Update(T model, CancellationToken ct = default) where T : MixtapeEntity, new() { throw new NotImplementedException(); } diff --git a/Finch/Media/ImageDimensionReader.cs b/mixtape/Media/ImageDimensionReader.cs similarity index 99% rename from Finch/Media/ImageDimensionReader.cs rename to mixtape/Media/ImageDimensionReader.cs index a51bb5dd..12160642 100644 --- a/Finch/Media/ImageDimensionReader.cs +++ b/mixtape/Media/ImageDimensionReader.cs @@ -3,7 +3,7 @@ using Microsoft.Extensions.Caching.Memory; using Microsoft.Extensions.FileProviders; using SixLabors.ImageSharp; -namespace Finch.Media; +namespace Mixtape.Media; public class ImageDimensionReader : IImageDimensionReader diff --git a/Finch/Media/ImageSharp/PhysicalFileProvider.cs b/mixtape/Media/ImageSharp/PhysicalFileProvider.cs similarity index 98% rename from Finch/Media/ImageSharp/PhysicalFileProvider.cs rename to mixtape/Media/ImageSharp/PhysicalFileProvider.cs index 6ebc9960..fc805062 100644 --- a/Finch/Media/ImageSharp/PhysicalFileProvider.cs +++ b/mixtape/Media/ImageSharp/PhysicalFileProvider.cs @@ -6,7 +6,7 @@ using SixLabors.ImageSharp.Web; using SixLabors.ImageSharp.Web.Providers; using SixLabors.ImageSharp.Web.Resolvers; -namespace Finch.Media.ImageSharp; +namespace Mixtape.Media.ImageSharp; /// /// Returns images stored in the local physical file system. diff --git a/Finch/Media/ImageSharp/PresetRequestParser.cs b/mixtape/Media/ImageSharp/PresetRequestParser.cs similarity index 99% rename from Finch/Media/ImageSharp/PresetRequestParser.cs rename to mixtape/Media/ImageSharp/PresetRequestParser.cs index 835d2e52..816f2ef3 100644 --- a/Finch/Media/ImageSharp/PresetRequestParser.cs +++ b/mixtape/Media/ImageSharp/PresetRequestParser.cs @@ -4,7 +4,7 @@ using Microsoft.Extensions.Options; using Microsoft.Extensions.Primitives; using SixLabors.ImageSharp.Web.Commands; -namespace Finch.Media.ImageSharp; +namespace Mixtape.Media.ImageSharp; /// /// Parses commands from the request querystring. diff --git a/Finch/Media/ImageSharp/Processors/BlurWebProcessor.cs b/mixtape/Media/ImageSharp/Processors/BlurWebProcessor.cs similarity index 96% rename from Finch/Media/ImageSharp/Processors/BlurWebProcessor.cs rename to mixtape/Media/ImageSharp/Processors/BlurWebProcessor.cs index 4a041757..730ad857 100644 --- a/Finch/Media/ImageSharp/Processors/BlurWebProcessor.cs +++ b/mixtape/Media/ImageSharp/Processors/BlurWebProcessor.cs @@ -5,7 +5,7 @@ using SixLabors.ImageSharp.Web.Commands; using SixLabors.ImageSharp.Web.Processors; using System.Globalization; -namespace Finch.Media.ImageSharp.Processors; +namespace Mixtape.Media.ImageSharp.Processors; public class BlurWebProcessor : IImageWebProcessor { diff --git a/Finch/Media/ImageSharp/Processors/LoopWebProcessor.cs b/mixtape/Media/ImageSharp/Processors/LoopWebProcessor.cs similarity index 97% rename from Finch/Media/ImageSharp/Processors/LoopWebProcessor.cs rename to mixtape/Media/ImageSharp/Processors/LoopWebProcessor.cs index 6822fb86..9f628b2d 100644 --- a/Finch/Media/ImageSharp/Processors/LoopWebProcessor.cs +++ b/mixtape/Media/ImageSharp/Processors/LoopWebProcessor.cs @@ -8,7 +8,7 @@ using SixLabors.ImageSharp.Formats.Gif; using SixLabors.ImageSharp.Formats.Png; using SixLabors.ImageSharp.Formats.Webp; -namespace Finch.Media.ImageSharp.Processors; +namespace Mixtape.Media.ImageSharp.Processors; public class LoopWebProcessor : IImageWebProcessor { diff --git a/Finch/Media/ImageSharp/Processors/RotateWebProcessor.cs b/mixtape/Media/ImageSharp/Processors/RotateWebProcessor.cs similarity index 96% rename from Finch/Media/ImageSharp/Processors/RotateWebProcessor.cs rename to mixtape/Media/ImageSharp/Processors/RotateWebProcessor.cs index 734c5481..00d1c333 100644 --- a/Finch/Media/ImageSharp/Processors/RotateWebProcessor.cs +++ b/mixtape/Media/ImageSharp/Processors/RotateWebProcessor.cs @@ -5,7 +5,7 @@ using SixLabors.ImageSharp.Web.Commands; using SixLabors.ImageSharp.Web.Processors; using System.Globalization; -namespace Finch.Media.ImageSharp.Processors; +namespace Mixtape.Media.ImageSharp.Processors; public class RotateWebProcessor : IImageWebProcessor { diff --git a/Finch/Media/ImageSharp/Processors/StripMetadataWebProcessor.cs b/mixtape/Media/ImageSharp/Processors/StripMetadataWebProcessor.cs similarity index 96% rename from Finch/Media/ImageSharp/Processors/StripMetadataWebProcessor.cs rename to mixtape/Media/ImageSharp/Processors/StripMetadataWebProcessor.cs index 945b24e1..05e13ae7 100644 --- a/Finch/Media/ImageSharp/Processors/StripMetadataWebProcessor.cs +++ b/mixtape/Media/ImageSharp/Processors/StripMetadataWebProcessor.cs @@ -5,7 +5,7 @@ using SixLabors.ImageSharp.Web.Processors; using System.Globalization; using SixLabors.ImageSharp.Processing; -namespace Finch.Media.ImageSharp.Processors; +namespace Mixtape.Media.ImageSharp.Processors; public class StripMetadataWebProcessor : IImageWebProcessor { diff --git a/Finch/Media/ImageSharp/RemoteImageCache.cs b/mixtape/Media/ImageSharp/RemoteImageCache.cs similarity index 98% rename from Finch/Media/ImageSharp/RemoteImageCache.cs rename to mixtape/Media/ImageSharp/RemoteImageCache.cs index 9582f5dd..9f8e2331 100644 --- a/Finch/Media/ImageSharp/RemoteImageCache.cs +++ b/mixtape/Media/ImageSharp/RemoteImageCache.cs @@ -1,7 +1,7 @@ // using Microsoft.Extensions.Logging; // using Microsoft.Extensions.Options; // -// namespace Finch.Media.ImageSharp; +// namespace Mixtape.Media.ImageSharp; // // public class RemoteImageCache : IRemoteImageCache // { diff --git a/Finch/Media/MediaApplicationBuilderExtensions.cs b/mixtape/Media/MediaApplicationBuilderExtensions.cs similarity index 95% rename from Finch/Media/MediaApplicationBuilderExtensions.cs rename to mixtape/Media/MediaApplicationBuilderExtensions.cs index 83baea95..ad13d688 100644 --- a/Finch/Media/MediaApplicationBuilderExtensions.cs +++ b/mixtape/Media/MediaApplicationBuilderExtensions.cs @@ -1,7 +1,7 @@ using Microsoft.AspNetCore.Builder; using Microsoft.Net.Http.Headers; -namespace Finch.Media; +namespace Mixtape.Media; public static class MediaApplicationBuilderExtensions { diff --git a/Finch/Media/MediaCreator.cs b/mixtape/Media/MediaCreator.cs similarity index 97% rename from Finch/Media/MediaCreator.cs rename to mixtape/Media/MediaCreator.cs index b9d173db..434dae31 100644 --- a/Finch/Media/MediaCreator.cs +++ b/mixtape/Media/MediaCreator.cs @@ -8,9 +8,9 @@ using SixLabors.ImageSharp.Processing; using System.IO; using Microsoft.Extensions.Logging; -namespace Finch.Media; +namespace Mixtape.Media; -public class MediaCreator(IMediaFileSystem fileSystem, IFinchOptions options, ILogger logger) : IMediaCreator +public class MediaCreator(IMediaFileSystem fileSystem, IMixtapeOptions options, ILogger logger) : IMediaCreator { protected IMediaFileSystem FileSystem { get; set; } = fileSystem; diff --git a/Finch/Media/MediaExtensions.cs b/mixtape/Media/MediaExtensions.cs similarity index 92% rename from Finch/Media/MediaExtensions.cs rename to mixtape/Media/MediaExtensions.cs index ad27d986..34493b32 100644 --- a/Finch/Media/MediaExtensions.cs +++ b/mixtape/Media/MediaExtensions.cs @@ -2,7 +2,7 @@ using SixLabors.ImageSharp.Web; using System.Numerics; -namespace Finch.Media; +namespace Mixtape.Media; public static class MediaExtensions { @@ -33,9 +33,9 @@ public static class MediaExtensions public static string Resize(this Media media, string preset) => media?.Path.Resize(preset, media?.Metadata?.FocalPoint, true); - public static string Resize(this string path, string preset, bool isFinchMedia) => path.Resize(preset, null, isFinchMedia); + public static string Resize(this string path, string preset, bool isMixtapeMedia) => path.Resize(preset, null, isMixtapeMedia); - public static string Resize(this string path, string preset, MediaFocalPoint focalPoint = null, bool isFinchMedia = false) + public static string Resize(this string path, string preset, MediaFocalPoint focalPoint = null, bool isMixtapeMedia = false) { if (path.IsNullOrEmpty()) { @@ -50,7 +50,7 @@ public static class MediaExtensions return string.Join('/', parts); } - if (isFinchMedia) + if (isMixtapeMedia) { // TODO this is bullshit because we need to get the base path from options return parts[1] == "media" || parts[0] == "media" diff --git a/Finch/Media/MediaFileSystem.cs b/mixtape/Media/MediaFileSystem.cs similarity index 96% rename from Finch/Media/MediaFileSystem.cs rename to mixtape/Media/MediaFileSystem.cs index d4681f13..bd38098d 100644 --- a/Finch/Media/MediaFileSystem.cs +++ b/mixtape/Media/MediaFileSystem.cs @@ -1,4 +1,4 @@ -namespace Finch.Media; +namespace Mixtape.Media; public class MediaFileSystem : PhysicalFileSystem, IMediaFileSystem { diff --git a/Finch/Media/MediaManagement.cs b/mixtape/Media/MediaManagement.cs similarity index 96% rename from Finch/Media/MediaManagement.cs rename to mixtape/Media/MediaManagement.cs index 570d8498..c31a35a5 100644 --- a/Finch/Media/MediaManagement.cs +++ b/mixtape/Media/MediaManagement.cs @@ -1,17 +1,17 @@ using System.IO; -namespace Finch.Media; +namespace Mixtape.Media; public class MediaManagement : IMediaManagement { protected IMediaFileSystem FileSystem { get; set; } - protected IFinchMediaStoreDbProvider Db { get; set; } + protected IMixtapeMediaStoreDbProvider Db { get; set; } protected IMediaCreator Creator { get; set; } - public MediaManagement(IMediaFileSystem fileSystem, IFinchMediaStoreDbProvider db, IMediaCreator creator) + public MediaManagement(IMediaFileSystem fileSystem, IMixtapeMediaStoreDbProvider db, IMediaCreator creator) { FileSystem = fileSystem; Db = db; diff --git a/Finch/Media/MediaManagementExtensions.cs b/mixtape/Media/MediaManagementExtensions.cs similarity index 99% rename from Finch/Media/MediaManagementExtensions.cs rename to mixtape/Media/MediaManagementExtensions.cs index 75ae075c..d8b50109 100644 --- a/Finch/Media/MediaManagementExtensions.cs +++ b/mixtape/Media/MediaManagementExtensions.cs @@ -1,7 +1,7 @@ using Microsoft.AspNetCore.Http; using System.IO; -namespace Finch.Media +namespace Mixtape.Media { public static class MediaManagementExtensions { diff --git a/Finch/Media/MediaMetadataCache.cs b/mixtape/Media/MediaMetadataCache.cs similarity index 89% rename from Finch/Media/MediaMetadataCache.cs rename to mixtape/Media/MediaMetadataCache.cs index c09945f0..5d514706 100644 --- a/Finch/Media/MediaMetadataCache.cs +++ b/mixtape/Media/MediaMetadataCache.cs @@ -1,6 +1,6 @@ using Microsoft.Extensions.Caching.Memory; -namespace Finch.Media; +namespace Mixtape.Media; public sealed class MediaMetadataCache { diff --git a/Finch/Media/MediaOptions.cs b/mixtape/Media/MediaOptions.cs similarity index 98% rename from Finch/Media/MediaOptions.cs rename to mixtape/Media/MediaOptions.cs index 0c032c4c..d02c63c2 100644 --- a/Finch/Media/MediaOptions.cs +++ b/mixtape/Media/MediaOptions.cs @@ -2,7 +2,7 @@ using SixLabors.ImageSharp.Processing; using SixLabors.ImageSharp.Web.Caching; -namespace Finch.Media; +namespace Mixtape.Media; public class MediaOptions { diff --git a/Finch/Media/FinchMediaModule.cs b/mixtape/Media/MixtapeMediaModule.cs similarity index 89% rename from Finch/Media/FinchMediaModule.cs rename to mixtape/Media/MixtapeMediaModule.cs index 103bcc54..0c2b226a 100644 --- a/Finch/Media/FinchMediaModule.cs +++ b/mixtape/Media/MixtapeMediaModule.cs @@ -7,13 +7,13 @@ using Microsoft.Extensions.Options; using SixLabors.ImageSharp.Web.Caching; using SixLabors.ImageSharp.Web.DependencyInjection; using System.IO; -using Finch.Media.ImageSharp; -using Finch.Media.ImageSharp.Processors; +using Mixtape.Media.ImageSharp; +using Mixtape.Media.ImageSharp.Processors; using Microsoft.Extensions.Hosting; -namespace Finch.Media; +namespace Mixtape.Media; -internal class FinchMediaModule : FinchModule +internal class MixtapeMediaModule : MixtapeModule { public override void ConfigureServices(IServiceCollection services, IConfiguration configuration) { @@ -51,7 +51,7 @@ internal class FinchMediaModule : FinchModule opts.CacheFolder = ".imagesharpcache"; } }) - .Bind(configuration.GetSection("Finch:Media:ImageSharp:Cache")); + .Bind(configuration.GetSection("Mixtape:Media:ImageSharp:Cache")); //configuration.AddJsonFile(Path.Combine(Directory.GetCurrentDirectory(), "Config/imaging.json"), true, true); //configuration.AddJsonFile(Path.Combine(Directory.GetCurrentDirectory(), $"Config/imaging.{builder.Environment.EnvironmentName}.json"), true); @@ -66,7 +66,7 @@ internal class FinchMediaModule : FinchModule services.AddScoped(); services.AddScoped(); services.AddScoped(); - services.AddScoped(); + services.AddScoped(); services.AddSingleton(); services.AddSingleton(); @@ -80,9 +80,9 @@ internal class FinchMediaModule : FinchModule // { "thumb", new ResizeOptions() { Size = new(100, 100), Mode = ResizeMode.Max } }, // { "preview", new ResizeOptions() { Size = new(210, 210), Mode = ResizeMode.Min } } // }; - }).Bind(configuration.GetSection("Finch:Media")); + }).Bind(configuration.GetSection("Mixtape:Media")); - // services.Configure(opts => + // services.Configure(opts => // { // RavenOptions raven = opts.For(); // raven.Indexes.Add(); diff --git a/Finch/Media/Models/Media.cs b/mixtape/Media/Models/Media.cs similarity index 89% rename from Finch/Media/Models/Media.cs rename to mixtape/Media/Models/Media.cs index 65557853..09f88112 100644 --- a/Finch/Media/Models/Media.cs +++ b/mixtape/Media/Models/Media.cs @@ -1,9 +1,9 @@ -namespace Finch.Media; +namespace Mixtape.Media; /// /// A media file (can contain an image or other media like videos and documents) /// -public class Media : FinchEntity, ISupportsTrees +public class Media : MixtapeEntity, ISupportsTrees { /// /// Whether this media item is a folder or a file @@ -47,7 +47,7 @@ public class Media : FinchEntity, ISupportsTrees /// /// Define custom thumbnails which are generated on upload - /// (see IFinchOptions.For().Thumbnails) + /// (see IMixtapeOptions.For().Thumbnails) /// public Dictionary Thumbnails { get; set; } = new(); } \ No newline at end of file diff --git a/Finch/Media/Models/MediaFocalPoint.cs b/mixtape/Media/Models/MediaFocalPoint.cs similarity index 91% rename from Finch/Media/Models/MediaFocalPoint.cs rename to mixtape/Media/Models/MediaFocalPoint.cs index c3a7b1f4..026fbc56 100644 --- a/Finch/Media/Models/MediaFocalPoint.cs +++ b/mixtape/Media/Models/MediaFocalPoint.cs @@ -1,4 +1,4 @@ -namespace Finch.Media; +namespace Mixtape.Media; /// /// The focal point sets the point of interest in an image with x/y coordinates from 0-1 diff --git a/Finch/Media/Models/MediaListItem.cs b/mixtape/Media/Models/MediaListItem.cs similarity index 84% rename from Finch/Media/Models/MediaListItem.cs rename to mixtape/Media/Models/MediaListItem.cs index 87f8e216..dbfd16a0 100644 --- a/Finch/Media/Models/MediaListItem.cs +++ b/mixtape/Media/Models/MediaListItem.cs @@ -1,6 +1,6 @@ -namespace Finch.Media; +namespace Mixtape.Media; -public class MediaListItem : FinchIdEntity +public class MediaListItem : MixtapeIdEntity { public string ParentId { get; set; } diff --git a/Finch/Media/Models/MediaMetadata.cs b/mixtape/Media/Models/MediaMetadata.cs similarity index 94% rename from Finch/Media/Models/MediaMetadata.cs rename to mixtape/Media/Models/MediaMetadata.cs index d6991441..5d1dd849 100644 --- a/Finch/Media/Models/MediaMetadata.cs +++ b/mixtape/Media/Models/MediaMetadata.cs @@ -1,4 +1,4 @@ -namespace Finch.Media; +namespace Mixtape.Media; /// /// Metadata for images/videos diff --git a/Finch/Media/Models/RemoteMedia.cs b/mixtape/Media/Models/RemoteMedia.cs similarity index 80% rename from Finch/Media/Models/RemoteMedia.cs rename to mixtape/Media/Models/RemoteMedia.cs index 295643fe..d737ad96 100644 --- a/Finch/Media/Models/RemoteMedia.cs +++ b/mixtape/Media/Models/RemoteMedia.cs @@ -1,4 +1,4 @@ -namespace Finch.Media; +namespace Mixtape.Media; public class RemoteMedia : Media { diff --git a/Finch/Media/Models/Video.cs b/mixtape/Media/Models/Video.cs similarity index 92% rename from Finch/Media/Models/Video.cs rename to mixtape/Media/Models/Video.cs index 6e757c30..8395d359 100644 --- a/Finch/Media/Models/Video.cs +++ b/mixtape/Media/Models/Video.cs @@ -1,4 +1,4 @@ -namespace Finch.Media; +namespace Mixtape.Media; public class Video { diff --git a/Finch/Media/StaticMediaCreator.cs b/mixtape/Media/StaticMediaCreator.cs similarity index 90% rename from Finch/Media/StaticMediaCreator.cs rename to mixtape/Media/StaticMediaCreator.cs index 66295b4a..f9513653 100644 --- a/Finch/Media/StaticMediaCreator.cs +++ b/mixtape/Media/StaticMediaCreator.cs @@ -5,7 +5,7 @@ using SixLabors.ImageSharp; using System.IO; using Microsoft.Extensions.Logging; -namespace Finch.Media; +namespace Mixtape.Media; public class StaticMediaCreator : MediaCreator, IStaticMediaCreator { @@ -14,7 +14,7 @@ public class StaticMediaCreator : MediaCreator, IStaticMediaCreator protected IFileProvider FileProvider { get; set; } - public StaticMediaCreator(IMediaFileSystem fileSystem, IFinchOptions options, IWebHostEnvironment hostingEnvironment, MediaMetadataCache cacheProvider, ILogger logger) : base(fileSystem, options, logger) + public StaticMediaCreator(IMediaFileSystem fileSystem, IMixtapeOptions options, IWebHostEnvironment hostingEnvironment, MediaMetadataCache cacheProvider, ILogger logger) : base(fileSystem, options, logger) { FileProvider = hostingEnvironment.WebRootFileProvider; Cache = cacheProvider.Cache; diff --git a/Finch/Metadata/Metadata.cs b/mixtape/Metadata/Metadata.cs similarity index 93% rename from Finch/Metadata/Metadata.cs rename to mixtape/Metadata/Metadata.cs index 871ef8cd..75ac2a55 100644 --- a/Finch/Metadata/Metadata.cs +++ b/mixtape/Metadata/Metadata.cs @@ -1,4 +1,4 @@ -namespace Finch.Metadata; +namespace Mixtape.Metadata; public class Metadata { diff --git a/Finch/Metadata/MetadataModule.cs b/mixtape/Metadata/MetadataModule.cs similarity index 77% rename from Finch/Metadata/MetadataModule.cs rename to mixtape/Metadata/MetadataModule.cs index 4d3e7c39..99015c85 100644 --- a/Finch/Metadata/MetadataModule.cs +++ b/mixtape/Metadata/MetadataModule.cs @@ -1,9 +1,9 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; -namespace Finch.Metadata; +namespace Mixtape.Metadata; -public class FinchMetadataModule : FinchModule +public class MixtapeMetadataModule : MixtapeModule { public override void ConfigureServices(IServiceCollection services, IConfiguration configuration) { diff --git a/Finch/Metadata/MetadataOptions.cs b/mixtape/Metadata/MetadataOptions.cs similarity index 95% rename from Finch/Metadata/MetadataOptions.cs rename to mixtape/Metadata/MetadataOptions.cs index 08aa8519..bdd45564 100644 --- a/Finch/Metadata/MetadataOptions.cs +++ b/mixtape/Metadata/MetadataOptions.cs @@ -1,4 +1,4 @@ -namespace Finch.Metadata; +namespace Mixtape.Metadata; public class MetadataOptions { diff --git a/Finch/Metadata/MetadataService.cs b/mixtape/Metadata/MetadataService.cs similarity index 98% rename from Finch/Metadata/MetadataService.cs rename to mixtape/Metadata/MetadataService.cs index d0acab70..4a113a4f 100644 --- a/Finch/Metadata/MetadataService.cs +++ b/mixtape/Metadata/MetadataService.cs @@ -2,7 +2,7 @@ using System.Text; using Microsoft.Extensions.Hosting; -namespace Finch.Metadata; +namespace Mixtape.Metadata; public class MetadataService(ILocalizer localizer, IHostEnvironment env) : IMetadataService { diff --git a/Finch/Metadata/Schema.cs b/mixtape/Metadata/Schema.cs similarity index 97% rename from Finch/Metadata/Schema.cs rename to mixtape/Metadata/Schema.cs index bddd91da..d4af7bb2 100644 --- a/Finch/Metadata/Schema.cs +++ b/mixtape/Metadata/Schema.cs @@ -1,7 +1,7 @@ //using Microsoft.AspNetCore.Mvc; //using System.Dynamic; -//namespace Finch.Metadata; +//namespace Mixtape.Metadata; //public class Schema //{ diff --git a/Finch/FinchBuilder.cs b/mixtape/MixtapeBuilder.cs similarity index 54% rename from Finch/FinchBuilder.cs rename to mixtape/MixtapeBuilder.cs index ee9c3b27..fc845d9f 100644 --- a/Finch/FinchBuilder.cs +++ b/mixtape/MixtapeBuilder.cs @@ -2,28 +2,28 @@ using Microsoft.AspNetCore.Antiforgery; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; -using Finch.Logging; -using Finch.Mails; -using Finch.Metadata; -using Finch.Mvc; -using Finch.Numbers; -using Finch.Routing; -using Finch.Security; +using Mixtape.Logging; +using Mixtape.Mails; +using Mixtape.Metadata; +using Mixtape.Mvc; +using Mixtape.Numbers; +using Mixtape.Routing; +using Mixtape.Security; -namespace Finch; +namespace Mixtape; // TODO maybe use a middleware like Hangfire does: https://github.com/HangfireIO/Hangfire/blob/master/src/Hangfire.AspNetCore/HangfireEndpointRouteBuilderExtensions.cs -public class FinchBuilder +public class MixtapeBuilder { public virtual IServiceCollection Services { get; } - internal static FinchModuleCollection Modules { get; } = new(); + internal static MixtapeModuleCollection Modules { get; } = new(); readonly IConfiguration _configuration; - public FinchBuilder(IServiceCollection services, IConfiguration configuration, Action setupAction) + public MixtapeBuilder(IServiceCollection services, IConfiguration configuration, Action setupAction) { Services = services; _configuration = configuration; @@ -34,8 +34,8 @@ public class FinchBuilder { IMvcBuilder mvcBuilder = services.AddMvc(); // create startup options - IFinchStartupOptions startupOptions = new FinchStartupOptions(mvcBuilder); - startupOptions.AssemblyDiscoveryRules.Add(new FinchAssemblyDiscoveryRule()); + IMixtapeStartupOptions startupOptions = new MixtapeStartupOptions(mvcBuilder); + startupOptions.AssemblyDiscoveryRules.Add(new MixtapeAssemblyDiscoveryRule()); setupAction?.Invoke(startupOptions); services.AddResponseCaching(); @@ -45,31 +45,31 @@ public class FinchBuilder mvcBuilder.AddDataAnnotationsLocalization(); - services.Configure(opts => opts.Cookie.Name = "finch.antiforgery"); + services.Configure(opts => opts.Cookie.Name = "mixtape.antiforgery"); // adds and discovers additional and built-in assemblies new AssemblyDiscovery(mvcBuilder).Execute(startupOptions.AssemblyDiscoveryRules); - Modules.Add(); + Modules.Add(); } - //string appName = configuration.GetValue("Finch:AppName").Or("finch-app"); + //string appName = configuration.GetValue("Mixtape:AppName").Or("mixtape-app"); //services.AddDataProtection();.PersistKeysToRegistry() - Modules.Add(); - Modules.Add(); - Modules.Add(); - Modules.Add(); - Modules.Add(); - Modules.Add(); - Modules.Add(); - Modules.Add(); - Modules.Add(); - Modules.Add(); - Modules.Add(); - Modules.Add(); - Modules.Add(); - Modules.Add(); + Modules.Add(); + Modules.Add(); + Modules.Add(); + Modules.Add(); + Modules.Add(); + Modules.Add(); + Modules.Add(); + Modules.Add(); + Modules.Add(); + Modules.Add(); + Modules.Add(); + Modules.Add(); + Modules.Add(); + Modules.Add(); Modules.ConfigureServices(services, configuration); @@ -81,14 +81,14 @@ public class FinchBuilder /// /// Use specified options /// - public FinchBuilder WithOptions(Action configureOptions) + public MixtapeBuilder WithOptions(Action configureOptions) { Services.Configure(configureOptions); return this; } - public FinchBuilder AddModule(IFinchModule module) + public MixtapeBuilder AddModule(IMixtapeModule module) { module.ConfigureServices(Services, _configuration); Modules.Add(module); @@ -96,7 +96,7 @@ public class FinchBuilder } - public FinchBuilder AddModule() where T : class, IFinchModule, new() + public MixtapeBuilder AddModule() where T : class, IMixtapeModule, new() { T module = new(); module.ConfigureServices(Services, _configuration); diff --git a/Finch/Models/Flavors/ConfigureFlavorJsonOptions.cs b/mixtape/Models/Flavors/ConfigureFlavorJsonOptions.cs similarity index 56% rename from Finch/Models/Flavors/ConfigureFlavorJsonOptions.cs rename to mixtape/Models/Flavors/ConfigureFlavorJsonOptions.cs index 8480946d..2212ee57 100644 --- a/Finch/Models/Flavors/ConfigureFlavorJsonOptions.cs +++ b/mixtape/Models/Flavors/ConfigureFlavorJsonOptions.cs @@ -1,20 +1,20 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Options; -namespace Finch.Models; +namespace Mixtape.Models; public class ConfigureFlavorJsonOptions : IConfigureOptions { - private readonly IFinchOptions _finchOptions; + private readonly IMixtapeOptions _mixtapeOptions; - public ConfigureFlavorJsonOptions(IFinchOptions options) + public ConfigureFlavorJsonOptions(IMixtapeOptions options) { - _finchOptions = options; + _mixtapeOptions = options; } public void Configure(JsonOptions options) { - options.JsonSerializerOptions.Converters.Add(new JsonFlavorVariantConverterFactory(_finchOptions)); + options.JsonSerializerOptions.Converters.Add(new JsonFlavorVariantConverterFactory(_mixtapeOptions)); } } \ No newline at end of file diff --git a/Finch/Models/Flavors/FlavorConfig.cs b/mixtape/Models/Flavors/FlavorConfig.cs similarity index 96% rename from Finch/Models/Flavors/FlavorConfig.cs rename to mixtape/Models/Flavors/FlavorConfig.cs index b7a9bf82..2c53ddd3 100644 --- a/Finch/Models/Flavors/FlavorConfig.cs +++ b/mixtape/Models/Flavors/FlavorConfig.cs @@ -1,6 +1,6 @@ using System.Text.Json.Serialization; -namespace Finch.Models; +namespace Mixtape.Models; /// /// A flavor config holds information about a flavor implementation diff --git a/Finch/Models/Flavors/FlavorOptions.cs b/mixtape/Models/Flavors/FlavorOptions.cs similarity index 99% rename from Finch/Models/Flavors/FlavorOptions.cs rename to mixtape/Models/Flavors/FlavorOptions.cs index 4be9d0bf..9a7bbc4e 100644 --- a/Finch/Models/Flavors/FlavorOptions.cs +++ b/mixtape/Models/Flavors/FlavorOptions.cs @@ -1,6 +1,6 @@ using System.Collections.Concurrent; -namespace Finch.Models; +namespace Mixtape.Models; public class FlavorOptions { diff --git a/Finch/Models/Flavors/FlavorProvider.cs b/mixtape/Models/Flavors/FlavorProvider.cs similarity index 96% rename from Finch/Models/Flavors/FlavorProvider.cs rename to mixtape/Models/Flavors/FlavorProvider.cs index 150f773e..db025568 100644 --- a/Finch/Models/Flavors/FlavorProvider.cs +++ b/mixtape/Models/Flavors/FlavorProvider.cs @@ -1,6 +1,6 @@ using System.Text.Json.Serialization; -namespace Finch.Models; +namespace Mixtape.Models; /// /// A flavor provider is attached to an entity (which has ISupportsFlavors) and contains all flavors diff --git a/Finch/Models/Flavors/FlavorProviderOptions.cs b/mixtape/Models/Flavors/FlavorProviderOptions.cs similarity index 98% rename from Finch/Models/Flavors/FlavorProviderOptions.cs rename to mixtape/Models/Flavors/FlavorProviderOptions.cs index af46e13b..d3ce1756 100644 --- a/Finch/Models/Flavors/FlavorProviderOptions.cs +++ b/mixtape/Models/Flavors/FlavorProviderOptions.cs @@ -1,4 +1,4 @@ -namespace Finch.Models; +namespace Mixtape.Models; public class FlavorProviderOptions where TEntity : class, ISupportsFlavors, new() { diff --git a/Finch/Models/Flavors/JsonFlavorVariantConverter.cs b/mixtape/Models/Flavors/JsonFlavorVariantConverter.cs similarity index 97% rename from Finch/Models/Flavors/JsonFlavorVariantConverter.cs rename to mixtape/Models/Flavors/JsonFlavorVariantConverter.cs index a06a52a0..0d8fad4f 100644 --- a/Finch/Models/Flavors/JsonFlavorVariantConverter.cs +++ b/mixtape/Models/Flavors/JsonFlavorVariantConverter.cs @@ -1,7 +1,7 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Finch.Models; +namespace Mixtape.Models; internal class JsonFlavorVariantConverter : JsonDiscriminatorConverter where T : class, ISupportsFlavors, new() { diff --git a/Finch/Models/Flavors/JsonFlavorVariantConverterFactory.cs b/mixtape/Models/Flavors/JsonFlavorVariantConverterFactory.cs similarity index 85% rename from Finch/Models/Flavors/JsonFlavorVariantConverterFactory.cs rename to mixtape/Models/Flavors/JsonFlavorVariantConverterFactory.cs index 86e06847..6741a384 100644 --- a/Finch/Models/Flavors/JsonFlavorVariantConverterFactory.cs +++ b/mixtape/Models/Flavors/JsonFlavorVariantConverterFactory.cs @@ -1,13 +1,13 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Finch.Models; +namespace Mixtape.Models; public class JsonFlavorVariantConverterFactory : JsonConverterFactory { - readonly IFinchOptions _options; + readonly IMixtapeOptions _options; - public JsonFlavorVariantConverterFactory(IFinchOptions options) + public JsonFlavorVariantConverterFactory(IMixtapeOptions options) { _options = options; } diff --git a/Finch/Models/ISupportsDbConventions.cs b/mixtape/Models/ISupportsDbConventions.cs similarity index 81% rename from Finch/Models/ISupportsDbConventions.cs rename to mixtape/Models/ISupportsDbConventions.cs index ef0587b7..6c4af43b 100644 --- a/Finch/Models/ISupportsDbConventions.cs +++ b/mixtape/Models/ISupportsDbConventions.cs @@ -1,4 +1,4 @@ -namespace Finch.Models; +namespace Mixtape.Models; /// /// Triggers custom conventions for database operations diff --git a/Finch/Models/ISupportsFlavors.cs b/mixtape/Models/ISupportsFlavors.cs similarity index 88% rename from Finch/Models/ISupportsFlavors.cs rename to mixtape/Models/ISupportsFlavors.cs index 14d7bcb7..1406949e 100644 --- a/Finch/Models/ISupportsFlavors.cs +++ b/mixtape/Models/ISupportsFlavors.cs @@ -1,4 +1,4 @@ -namespace Finch.Models; +namespace Mixtape.Models; public interface ISupportsFlavors { diff --git a/Finch/Models/ISupportsRouting.cs b/mixtape/Models/ISupportsRouting.cs similarity index 89% rename from Finch/Models/ISupportsRouting.cs rename to mixtape/Models/ISupportsRouting.cs index 790441fc..f6ddeb1f 100644 --- a/Finch/Models/ISupportsRouting.cs +++ b/mixtape/Models/ISupportsRouting.cs @@ -1,4 +1,4 @@ -namespace Finch.Models; +namespace Mixtape.Models; public interface ISupportsRouting { diff --git a/Finch/Models/ISupportsSoftDelete.cs b/mixtape/Models/ISupportsSoftDelete.cs similarity index 83% rename from Finch/Models/ISupportsSoftDelete.cs rename to mixtape/Models/ISupportsSoftDelete.cs index 6859d4d7..c888206b 100644 --- a/Finch/Models/ISupportsSoftDelete.cs +++ b/mixtape/Models/ISupportsSoftDelete.cs @@ -1,4 +1,4 @@ -namespace Finch.Models; +namespace Mixtape.Models; public interface ISupportsSoftDelete { diff --git a/Finch/Models/ISupportsSorting.cs b/mixtape/Models/ISupportsSorting.cs similarity index 79% rename from Finch/Models/ISupportsSorting.cs rename to mixtape/Models/ISupportsSorting.cs index c92b1fb4..aeebf45b 100644 --- a/Finch/Models/ISupportsSorting.cs +++ b/mixtape/Models/ISupportsSorting.cs @@ -1,4 +1,4 @@ -namespace Finch.Models; +namespace Mixtape.Models; public interface ISupportsSorting { diff --git a/Finch/Models/ISupportsTrees.cs b/mixtape/Models/ISupportsTrees.cs similarity index 90% rename from Finch/Models/ISupportsTrees.cs rename to mixtape/Models/ISupportsTrees.cs index e4234eca..661a67c8 100644 --- a/Finch/Models/ISupportsTrees.cs +++ b/mixtape/Models/ISupportsTrees.cs @@ -1,4 +1,4 @@ -namespace Finch.Models; +namespace Mixtape.Models; public interface ISupportsTrees { diff --git a/Finch/Models/FinchEntity.cs b/mixtape/Models/MixtapeEntity.cs similarity index 91% rename from Finch/Models/FinchEntity.cs rename to mixtape/Models/MixtapeEntity.cs index 710a0fb7..32343b6c 100644 --- a/Finch/Models/FinchEntity.cs +++ b/mixtape/Models/MixtapeEntity.cs @@ -1,9 +1,9 @@ using System.Diagnostics; -namespace Finch.Models; +namespace Mixtape.Models; [DebuggerDisplay("Id = {Id,nq}, Name = {Name}, Alias = {Alias}")] -public class FinchEntity : FinchIdEntity, ISupportsDbConventions, ISupportsRouting, ISupportsFlavors, ISupportsSorting +public class MixtapeEntity : MixtapeIdEntity, ISupportsDbConventions, ISupportsRouting, ISupportsFlavors, ISupportsSorting { /// /// Full name of the entity diff --git a/Finch/Models/FinchIdEntity.cs b/mixtape/Models/MixtapeIdEntity.cs similarity index 61% rename from Finch/Models/FinchIdEntity.cs rename to mixtape/Models/MixtapeIdEntity.cs index caff5fe4..1089d2e1 100644 --- a/Finch/Models/FinchIdEntity.cs +++ b/mixtape/Models/MixtapeIdEntity.cs @@ -1,6 +1,6 @@ -namespace Finch.Models; +namespace Mixtape.Models; -public class FinchIdEntity +public class MixtapeIdEntity { /// /// Id of the entity diff --git a/mixtape/Models/MixtapeReference.cs b/mixtape/Models/MixtapeReference.cs new file mode 100644 index 00000000..ac596f17 --- /dev/null +++ b/mixtape/Models/MixtapeReference.cs @@ -0,0 +1,30 @@ +namespace Mixtape.Models; + +public class MixtapeReference +{ + public MixtapeReference() { } + + public MixtapeReference(MixtapeEntity entity) + { + Id = entity.Id; + Name = entity.Name; + } + + public static MixtapeReference From(MixtapeEntity entity) + { + return entity == null ? null : new MixtapeReference(entity); + } + + public static MixtapeReference From(T entity, Func transform) where T : MixtapeEntity + { + return entity == null ? null : new MixtapeReference() + { + Id = entity.Id, + Name = transform(entity) + }; + } + + public string Id { get; set; } + + public string Name { get; set; } +} diff --git a/Finch/Models/Results/Paged.cs b/mixtape/Models/Results/Paged.cs similarity index 98% rename from Finch/Models/Results/Paged.cs rename to mixtape/Models/Results/Paged.cs index e9db04fc..1f07855c 100644 --- a/Finch/Models/Results/Paged.cs +++ b/mixtape/Models/Results/Paged.cs @@ -1,4 +1,4 @@ -namespace Finch.Models; +namespace Mixtape.Models; public class Paged : Paged { diff --git a/Finch/Models/Results/Result.cs b/mixtape/Models/Results/Result.cs similarity index 99% rename from Finch/Models/Results/Result.cs rename to mixtape/Models/Results/Result.cs index 8bfd21a5..c78952b4 100644 --- a/Finch/Models/Results/Result.cs +++ b/mixtape/Models/Results/Result.cs @@ -1,7 +1,7 @@ using FluentValidation.Results; using System.Runtime.Serialization; -namespace Finch.Models; +namespace Mixtape.Models; [DataContract(Name = "result", Namespace = "")] diff --git a/Finch/Models/Results/UrlsResult.cs b/mixtape/Models/Results/UrlsResult.cs similarity index 97% rename from Finch/Models/Results/UrlsResult.cs rename to mixtape/Models/Results/UrlsResult.cs index c4208265..105a5356 100644 --- a/Finch/Models/Results/UrlsResult.cs +++ b/mixtape/Models/Results/UrlsResult.cs @@ -1,4 +1,4 @@ -namespace Finch.Models; +namespace Mixtape.Models; public class UrlResult { diff --git a/Finch/Modules/FinchModule.cs b/mixtape/Modules/MixtapeModule.cs similarity index 93% rename from Finch/Modules/FinchModule.cs rename to mixtape/Modules/MixtapeModule.cs index 9d0a5787..af275013 100644 --- a/Finch/Modules/FinchModule.cs +++ b/mixtape/Modules/MixtapeModule.cs @@ -3,9 +3,9 @@ using Microsoft.AspNetCore.Routing; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; -namespace Finch.Modules; +namespace Mixtape.Modules; -public abstract class FinchModule : IFinchModule +public abstract class MixtapeModule : IMixtapeModule { /// public virtual int Order { get; } = 0; @@ -21,7 +21,7 @@ public abstract class FinchModule : IFinchModule } -public interface IFinchModule +public interface IMixtapeModule { /// /// Get the value to use to order startups to configure services. The default is 0. diff --git a/Finch/Modules/FinchModuleCollection.cs b/mixtape/Modules/MixtapeModuleCollection.cs similarity index 70% rename from Finch/Modules/FinchModuleCollection.cs rename to mixtape/Modules/MixtapeModuleCollection.cs index bf0fadf3..3ef6cdb8 100644 --- a/Finch/Modules/FinchModuleCollection.cs +++ b/mixtape/Modules/MixtapeModuleCollection.cs @@ -4,41 +4,41 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using System.Collections.Concurrent; -namespace Finch.Modules; +namespace Mixtape.Modules; -public class FinchModuleCollection : FinchModule +public class MixtapeModuleCollection : MixtapeModule { - ConcurrentDictionary _modules = new(); + ConcurrentDictionary _modules = new(); /// /// Get all registered modules /// - public IEnumerable GetAll() => _modules.Values; + public IEnumerable GetAll() => _modules.Values; /// - /// Adds a finch module + /// Adds a mixtape module /// - public void Add() where T : class, IFinchModule, new() + public void Add() where T : class, IMixtapeModule, new() { Add(new T()); } /// - /// Adds a finch module + /// Adds a mixtape module /// - public void Add(T moduleInstance) where T : IFinchModule + public void Add(T moduleInstance) where T : IMixtapeModule { Add(typeof(T), moduleInstance); } /// - /// Adds a finch module + /// Adds a mixtape module /// - public void Add(Type moduleType, IFinchModule moduleInstance) + public void Add(Type moduleType, IMixtapeModule moduleInstance) { if (_modules.ContainsKey(moduleType)) { diff --git a/Finch/Mvc/DisableBrowserCacheFilter.cs b/mixtape/Mvc/DisableBrowserCacheFilter.cs similarity index 97% rename from Finch/Mvc/DisableBrowserCacheFilter.cs rename to mixtape/Mvc/DisableBrowserCacheFilter.cs index 2ba395d5..f1e0a3d2 100644 --- a/Finch/Mvc/DisableBrowserCacheFilter.cs +++ b/mixtape/Mvc/DisableBrowserCacheFilter.cs @@ -2,7 +2,7 @@ using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.Net.Http.Headers; -namespace Finch.Mvc; +namespace Mixtape.Mvc; /// /// Ensures that the request is not cached by the browser diff --git a/mixtape/Mvc/MixtapeApiController.cs b/mixtape/Mvc/MixtapeApiController.cs new file mode 100644 index 00000000..3fe3ecf6 --- /dev/null +++ b/mixtape/Mvc/MixtapeApiController.cs @@ -0,0 +1,8 @@ +using Microsoft.AspNetCore.Mvc; + +namespace Mixtape.Mvc; + +[ApiController] +public abstract class MixtapeApiController : MixtapeController +{ +} \ No newline at end of file diff --git a/mixtape/Mvc/MixtapeController.cs b/mixtape/Mvc/MixtapeController.cs new file mode 100644 index 00000000..96078521 --- /dev/null +++ b/mixtape/Mvc/MixtapeController.cs @@ -0,0 +1,10 @@ +using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.DependencyInjection; + +namespace Mixtape.Mvc; + +public abstract class MixtapeController : Controller +{ + IMixtapeContext _context; + public IMixtapeContext Context => _context ??= HttpContext?.RequestServices?.GetService(); +} \ No newline at end of file diff --git a/Finch/Mvc/FinchMvcModule.cs b/mixtape/Mvc/MixtapeMvcModule.cs similarity index 88% rename from Finch/Mvc/FinchMvcModule.cs rename to mixtape/Mvc/MixtapeMvcModule.cs index 22a69026..15d27b08 100644 --- a/Finch/Mvc/FinchMvcModule.cs +++ b/mixtape/Mvc/MixtapeMvcModule.cs @@ -3,9 +3,9 @@ using Microsoft.AspNetCore.Routing; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; -namespace Finch.Mvc; +namespace Mixtape.Mvc; -public class FinchMvcModule : FinchModule +public class MixtapeMvcModule : MixtapeModule { public override void ConfigureServices(IServiceCollection services, IConfiguration configuration) { diff --git a/Finch/Mvc/FinchPageModel.cs b/mixtape/Mvc/MixtapePageModel.cs similarity index 77% rename from Finch/Mvc/FinchPageModel.cs rename to mixtape/Mvc/MixtapePageModel.cs index 5677e698..224ebeee 100644 --- a/Finch/Mvc/FinchPageModel.cs +++ b/mixtape/Mvc/MixtapePageModel.cs @@ -2,17 +2,17 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.Extensions.DependencyInjection; -using Finch.Metadata; +using Mixtape.Metadata; -namespace Finch.Mvc; +namespace Mixtape.Mvc; -public class FinchPageModel : PageModel +public class MixtapePageModel : PageModel { /// - /// Get access to the finch context for this request + /// Get access to the mixtape context for this request /// - public IFinchContext FinchContext => _finchContext ??= HttpContext?.RequestServices?.GetService(); - IFinchContext _finchContext; + public IMixtapeContext MixtapeContext => _mixtapeContext ??= HttpContext?.RequestServices?.GetService(); + IMixtapeContext _mixtapeContext; /// /// Get access to the localizer diff --git a/Finch/Numbers/IFinchNumberStoreDbProvider.cs b/mixtape/Numbers/IMixtapeNumberStoreDbProvider.cs similarity index 62% rename from Finch/Numbers/IFinchNumberStoreDbProvider.cs rename to mixtape/Numbers/IMixtapeNumberStoreDbProvider.cs index f384572a..2f224feb 100644 --- a/Finch/Numbers/IFinchNumberStoreDbProvider.cs +++ b/mixtape/Numbers/IMixtapeNumberStoreDbProvider.cs @@ -1,51 +1,51 @@ using System.Linq.Expressions; -namespace Finch.Numbers; +namespace Mixtape.Numbers; -public interface IFinchNumberStoreDbProvider +public interface IMixtapeNumberStoreDbProvider { - Task Load(string id, CancellationToken ct = default) where T : FinchEntity, new(); + Task Load(string id, CancellationToken ct = default) where T : MixtapeEntity, new(); - Task Find(Expression> expression, CancellationToken ct = default) where T : FinchEntity; + Task Find(Expression> expression, CancellationToken ct = default) where T : MixtapeEntity; - Task> FindAll(Expression> expression, CancellationToken ct = default) where T : FinchEntity; + Task> FindAll(Expression> expression, CancellationToken ct = default) where T : MixtapeEntity; - Task> Create(T model, CancellationToken ct = default) where T : FinchEntity, new(); + Task> Create(T model, CancellationToken ct = default) where T : MixtapeEntity, new(); - Task> Update(T model, CancellationToken ct = default) where T : FinchEntity, new(); + Task> Update(T model, CancellationToken ct = default) where T : MixtapeEntity, new(); - Task> Delete(T model, CancellationToken ct = default) where T : FinchEntity, new(); + Task> Delete(T model, CancellationToken ct = default) where T : MixtapeEntity, new(); } -public class EmptyFinchNumberStoreDbProvider : IFinchNumberStoreDbProvider +public class EmptyMixtapeNumberStoreDbProvider : IMixtapeNumberStoreDbProvider { - public Task> Create(T model, CancellationToken ct = default) where T : FinchEntity, new() + public Task> Create(T model, CancellationToken ct = default) where T : MixtapeEntity, new() { throw new NotImplementedException(); } - public Task> Delete(T model, CancellationToken ct = default) where T : FinchEntity, new() + public Task> Delete(T model, CancellationToken ct = default) where T : MixtapeEntity, new() { throw new NotImplementedException(); } - public Task Find(Expression> expression, CancellationToken ct = default) where T : FinchEntity + public Task Find(Expression> expression, CancellationToken ct = default) where T : MixtapeEntity { throw new NotImplementedException(); } - public Task> FindAll(Expression> expression, CancellationToken ct = default) where T : FinchEntity + public Task> FindAll(Expression> expression, CancellationToken ct = default) where T : MixtapeEntity { throw new NotImplementedException(); } - public Task Load(string id, CancellationToken ct = default) where T : FinchEntity, new() + public Task Load(string id, CancellationToken ct = default) where T : MixtapeEntity, new() { throw new NotImplementedException(); } - public Task> Update(T model, CancellationToken ct = default) where T : FinchEntity, new() + public Task> Update(T model, CancellationToken ct = default) where T : MixtapeEntity, new() { throw new NotImplementedException(); } diff --git a/Finch/Numbers/FinchNumberModule.cs b/mixtape/Numbers/MixtapeNumberModule.cs similarity index 67% rename from Finch/Numbers/FinchNumberModule.cs rename to mixtape/Numbers/MixtapeNumberModule.cs index cc0340fd..07deb4bc 100644 --- a/Finch/Numbers/FinchNumberModule.cs +++ b/mixtape/Numbers/MixtapeNumberModule.cs @@ -2,16 +2,16 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; -namespace Finch.Numbers; +namespace Mixtape.Numbers; -internal class FinchNumberModule : FinchModule +internal class MixtapeNumberModule : MixtapeModule { public override void ConfigureServices(IServiceCollection services, IConfiguration configuration) { - services.AddOptions().Bind(configuration.GetSection("Finch:Numbers")); + services.AddOptions().Bind(configuration.GetSection("Mixtape:Numbers")); services.AddScoped(); services.AddScoped, NumberValidator>(); - services.AddScoped(); + services.AddScoped(); } } \ No newline at end of file diff --git a/Finch/Numbers/Number.cs b/mixtape/Numbers/Number.cs similarity index 96% rename from Finch/Numbers/Number.cs rename to mixtape/Numbers/Number.cs index 9f2223e6..2ec00225 100644 --- a/Finch/Numbers/Number.cs +++ b/mixtape/Numbers/Number.cs @@ -1,4 +1,4 @@ -namespace Finch.Numbers; +namespace Mixtape.Numbers; /// /// Configuration of number generation @@ -10,7 +10,7 @@ /// {date} for the date in dd-mm-yyyy /// {date:dmy} for the date in a custom format, where dmy is a nested placeholder for the format /// -public class Number : FinchEntity +public class Number : MixtapeEntity { /// /// The template to build the number. diff --git a/Finch/Numbers/NumberOptions.cs b/mixtape/Numbers/NumberOptions.cs similarity index 91% rename from Finch/Numbers/NumberOptions.cs rename to mixtape/Numbers/NumberOptions.cs index 8e2e6074..84aa4ac3 100644 --- a/Finch/Numbers/NumberOptions.cs +++ b/mixtape/Numbers/NumberOptions.cs @@ -1,4 +1,4 @@ -namespace Finch.Numbers; +namespace Mixtape.Numbers; public class NumberOptions : Dictionary { diff --git a/Finch/Numbers/NumberValidator.cs b/mixtape/Numbers/NumberValidator.cs similarity index 81% rename from Finch/Numbers/NumberValidator.cs rename to mixtape/Numbers/NumberValidator.cs index 8fcbf2e6..2661fd23 100644 --- a/Finch/Numbers/NumberValidator.cs +++ b/mixtape/Numbers/NumberValidator.cs @@ -1,8 +1,8 @@ using FluentValidation; -namespace Finch.Numbers; +namespace Mixtape.Numbers; -public class NumberValidator : FinchValidator +public class NumberValidator : MixtapeValidator { public NumberValidator() { diff --git a/Finch/Numbers/Numbers.cs b/mixtape/Numbers/Numbers.cs similarity index 96% rename from Finch/Numbers/Numbers.cs rename to mixtape/Numbers/Numbers.cs index 15f618a6..75b81c1f 100644 --- a/Finch/Numbers/Numbers.cs +++ b/mixtape/Numbers/Numbers.cs @@ -1,12 +1,12 @@ using System.Text.RegularExpressions; -namespace Finch.Numbers; +namespace Mixtape.Numbers; public class Numbers : INumbers { - protected IFinchNumberStoreDbProvider Db { get; set; } + protected IMixtapeNumberStoreDbProvider Db { get; set; } - protected IFinchOptions Options { get; set; } + protected IMixtapeOptions Options { get; set; } const string DEFAULT_COUNTER = "Default"; Regex templateRegex = new("{(date|number|year|random):?([a-zA-Z0-9-_]*)}", RegexOptions.IgnoreCase); @@ -14,7 +14,7 @@ public class Numbers : INumbers Random random = new(); - public Numbers(IFinchNumberStoreDbProvider db, IFinchOptions options) + public Numbers(IMixtapeNumberStoreDbProvider db, IMixtapeOptions options) { Db = db; Options = options; @@ -189,7 +189,7 @@ public class Numbers : INumbers if (options == null) { - throw new KeyNotFoundException($"Could not find number options (finch:numbers:) for alias {alias}"); + throw new KeyNotFoundException($"Could not find number options (mixtape:numbers:) for alias {alias}"); } string id = Id(alias); diff --git a/Finch/Rendering/IconOptions.cs b/mixtape/Rendering/IconOptions.cs similarity index 92% rename from Finch/Rendering/IconOptions.cs rename to mixtape/Rendering/IconOptions.cs index 8949b5af..26a22909 100644 --- a/Finch/Rendering/IconOptions.cs +++ b/mixtape/Rendering/IconOptions.cs @@ -1,4 +1,4 @@ -namespace Finch.Rendering; +namespace Mixtape.Rendering; public class IconOptions : IconSetOptions { diff --git a/Finch/Rendering/FinchRenderingModule.cs b/mixtape/Rendering/MixtapeRenderingModule.cs similarity index 75% rename from Finch/Rendering/FinchRenderingModule.cs rename to mixtape/Rendering/MixtapeRenderingModule.cs index 4395a4fb..77d8551c 100644 --- a/Finch/Rendering/FinchRenderingModule.cs +++ b/mixtape/Rendering/MixtapeRenderingModule.cs @@ -1,14 +1,14 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; -namespace Finch.Rendering; +namespace Mixtape.Rendering; -public class FinchRenderingModule : FinchModule +public class MixtapeRenderingModule : MixtapeModule { public override void ConfigureServices(IServiceCollection services, IConfiguration configuration) { services.AddScoped(); - services.AddOptions().Bind(configuration.GetSection("Finch:Icons")); + services.AddOptions().Bind(configuration.GetSection("Mixtape:Icons")); } } \ No newline at end of file diff --git a/Finch/Rendering/QrCode/BitArrayExtensions.cs b/mixtape/Rendering/QrCode/BitArrayExtensions.cs similarity index 99% rename from Finch/Rendering/QrCode/BitArrayExtensions.cs rename to mixtape/Rendering/QrCode/BitArrayExtensions.cs index 2c569b0b..5d1336d6 100644 --- a/Finch/Rendering/QrCode/BitArrayExtensions.cs +++ b/mixtape/Rendering/QrCode/BitArrayExtensions.cs @@ -25,7 +25,7 @@ * IN THE SOFTWARE. */ -namespace Finch.Rendering.QrCode; +namespace Mixtape.Rendering.QrCode; /// /// Extension methods for the class. diff --git a/Finch/Rendering/QrCode/DataTooLongException.cs b/mixtape/Rendering/QrCode/DataTooLongException.cs similarity index 98% rename from Finch/Rendering/QrCode/DataTooLongException.cs rename to mixtape/Rendering/QrCode/DataTooLongException.cs index 8a714058..8c8a01ea 100644 --- a/Finch/Rendering/QrCode/DataTooLongException.cs +++ b/mixtape/Rendering/QrCode/DataTooLongException.cs @@ -25,7 +25,7 @@ * IN THE SOFTWARE. */ -namespace Finch.Rendering.QrCode; +namespace Mixtape.Rendering.QrCode; /// /// The exception that is thrown when the supplied data does not fit in the QR code. diff --git a/Finch/Rendering/QrCode/Objects.cs b/mixtape/Rendering/QrCode/Objects.cs similarity index 98% rename from Finch/Rendering/QrCode/Objects.cs rename to mixtape/Rendering/QrCode/Objects.cs index aad3f25c..b22e86c1 100644 --- a/Finch/Rendering/QrCode/Objects.cs +++ b/mixtape/Rendering/QrCode/Objects.cs @@ -25,7 +25,7 @@ * IN THE SOFTWARE. */ -namespace Finch.Rendering.QrCode; +namespace Mixtape.Rendering.QrCode; /// /// Helper functions to check for valid arguments. diff --git a/Finch/Rendering/QrCode/QrCode.cs b/mixtape/Rendering/QrCode/QrCode.cs similarity index 99% rename from Finch/Rendering/QrCode/QrCode.cs rename to mixtape/Rendering/QrCode/QrCode.cs index c1ec05c0..d1a46891 100644 --- a/Finch/Rendering/QrCode/QrCode.cs +++ b/mixtape/Rendering/QrCode/QrCode.cs @@ -28,7 +28,7 @@ using System.Diagnostics; using System.Text; -namespace Finch.Rendering.QrCode; +namespace Mixtape.Rendering.QrCode; /// /// Represents a QR code containing text or binary data. @@ -810,7 +810,7 @@ public class QrCode // The function modules must be marked and the codeword bits must be drawn // before masking. Due to the arithmetic of XOR, calling applyMask() with // the same mask value a second time will undo the mask. A final well-formed - // QR code needs exactly one (not finch, two, etc.) mask applied. + // QR code needs exactly one (not mixtape, two, etc.) mask applied. private void ApplyMask(uint mask) { if (mask > 7) diff --git a/Finch/Rendering/QrCode/QrSegment.cs b/mixtape/Rendering/QrCode/QrSegment.cs similarity index 99% rename from Finch/Rendering/QrCode/QrSegment.cs rename to mixtape/Rendering/QrCode/QrSegment.cs index ae94c7f8..ee4ca3de 100644 --- a/Finch/Rendering/QrCode/QrSegment.cs +++ b/mixtape/Rendering/QrCode/QrSegment.cs @@ -29,7 +29,7 @@ using System.Diagnostics; using System.Text; using System.Text.RegularExpressions; -namespace Finch.Rendering.QrCode; +namespace Mixtape.Rendering.QrCode; /// /// Represents a segment of character/binary/control data in a QR code symbol. @@ -151,7 +151,7 @@ public class QrSegment /// - /// Creates a list of finch or more segments representing the specified text string. + /// Creates a list of mixtape or more segments representing the specified text string. /// /// The text may contain the full range of Unicode characters. /// diff --git a/Finch/Rendering/QrCode/QrSegmentAdvanced.cs b/mixtape/Rendering/QrCode/QrSegmentAdvanced.cs similarity index 99% rename from Finch/Rendering/QrCode/QrSegmentAdvanced.cs rename to mixtape/Rendering/QrCode/QrSegmentAdvanced.cs index 34f7b121..bab2c342 100644 --- a/Finch/Rendering/QrCode/QrSegmentAdvanced.cs +++ b/mixtape/Rendering/QrCode/QrSegmentAdvanced.cs @@ -27,9 +27,9 @@ using System.Diagnostics; using System.Text; -using static Finch.Rendering.QrCode.QrSegment; +using static Mixtape.Rendering.QrCode.QrSegment; -namespace Finch.Rendering.QrCode; +namespace Mixtape.Rendering.QrCode; /// /// Advanced methods for encoding QR codes using Kanji mode or using multiple segments with different encodings. @@ -41,7 +41,7 @@ public static class QrSegmentAdvanced #region Optimal list of segments encoder /// - /// Creates a list of finch or more segments to represent the specified text string. + /// Creates a list of mixtape or more segments to represent the specified text string. /// The resulting list optimally minimizes the total encoded bit length, subjected to the constraints /// of the specified error correction level, minimum and maximum version number. /// diff --git a/Finch/Rendering/QrCode/ReedSolomonGenerator.cs b/mixtape/Rendering/QrCode/ReedSolomonGenerator.cs similarity index 99% rename from Finch/Rendering/QrCode/ReedSolomonGenerator.cs rename to mixtape/Rendering/QrCode/ReedSolomonGenerator.cs index 2d63320c..ca175a60 100644 --- a/Finch/Rendering/QrCode/ReedSolomonGenerator.cs +++ b/mixtape/Rendering/QrCode/ReedSolomonGenerator.cs @@ -27,7 +27,7 @@ using System.Diagnostics; -namespace Finch.Rendering.QrCode; +namespace Mixtape.Rendering.QrCode; /// /// Computes the Reed-Solomon error correction codewords for a sequence of data codewords at a given degree. diff --git a/Finch/Rendering/RazorRenderer.cs b/mixtape/Rendering/RazorRenderer.cs similarity index 99% rename from Finch/Rendering/RazorRenderer.cs rename to mixtape/Rendering/RazorRenderer.cs index b68a39cc..a2311084 100644 --- a/Finch/Rendering/RazorRenderer.cs +++ b/mixtape/Rendering/RazorRenderer.cs @@ -15,7 +15,7 @@ using System.Diagnostics; using System.IO; using System.Text.Encodings.Web; -namespace Finch.Rendering; +namespace Mixtape.Rendering; public class RazorRenderer : IRazorRenderer, IDisposable { diff --git a/Finch/Routing/FinchRoutingModule.cs b/mixtape/Routing/MixtapeRoutingModule.cs similarity index 77% rename from Finch/Routing/FinchRoutingModule.cs rename to mixtape/Routing/MixtapeRoutingModule.cs index 06211fc7..a105cc79 100644 --- a/Finch/Routing/FinchRoutingModule.cs +++ b/mixtape/Routing/MixtapeRoutingModule.cs @@ -1,9 +1,9 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; -namespace Finch.Routing; +namespace Mixtape.Routing; -internal class FinchRoutingModule : FinchModule +internal class MixtapeRoutingModule : MixtapeModule { public override void ConfigureServices(IServiceCollection services, IConfiguration configuration) { diff --git a/Finch/Routing/RequestUrlResolver.cs b/mixtape/Routing/RequestUrlResolver.cs similarity index 99% rename from Finch/Routing/RequestUrlResolver.cs rename to mixtape/Routing/RequestUrlResolver.cs index 31342f01..2d80a4d0 100644 --- a/Finch/Routing/RequestUrlResolver.cs +++ b/mixtape/Routing/RequestUrlResolver.cs @@ -1,7 +1,7 @@ using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Logging; -namespace Finch.Routing; +namespace Mixtape.Routing; public class RequestUrlResolver : IRequestUrlResolver { diff --git a/Finch/Security/CaptchaController.cs b/mixtape/Security/CaptchaController.cs similarity index 81% rename from Finch/Security/CaptchaController.cs rename to mixtape/Security/CaptchaController.cs index 2e93330e..14755de0 100644 --- a/Finch/Security/CaptchaController.cs +++ b/mixtape/Security/CaptchaController.cs @@ -3,13 +3,13 @@ using System.Reflection; using Microsoft.AspNetCore.Mvc; using PowCapServer.Abstractions; using PowCapServer.Models; -using Finch.Mvc; +using Mixtape.Mvc; -namespace Finch.Security; +namespace Mixtape.Security; [ApiController] [Route("/api/captcha")] -public class CaptchaController(ICaptchaService captchaService) : FinchController +public class CaptchaController(ICaptchaService captchaService) : MixtapeController { [HttpPost("challenge")] public async Task PostChallenge() @@ -56,8 +56,8 @@ public class CaptchaController(ICaptchaService captchaService) : FinchController [HttpGet("cap.wasm")] public IActionResult GetWasmFile() { - Assembly assembly = typeof(FinchSecurityModule).GetTypeInfo().Assembly; - Stream resource = assembly.GetManifestResourceStream("finch/res/cap/cap.wasm"); + Assembly assembly = typeof(MixtapeSecurityModule).GetTypeInfo().Assembly; + Stream resource = assembly.GetManifestResourceStream("mixtape/res/cap/cap.wasm"); if (resource is null) { @@ -71,8 +71,8 @@ public class CaptchaController(ICaptchaService captchaService) : FinchController [HttpGet("cap.widget.js")] public IActionResult GetWidgetJsFile() { - Assembly assembly = typeof(FinchSecurityModule).GetTypeInfo().Assembly; - Stream resource = assembly.GetManifestResourceStream("finch/res/cap/cap.js"); + Assembly assembly = typeof(MixtapeSecurityModule).GetTypeInfo().Assembly; + Stream resource = assembly.GetManifestResourceStream("mixtape/res/cap/cap.js"); if (resource is null) { diff --git a/Finch/Security/CaptchaOptions.cs b/mixtape/Security/CaptchaOptions.cs similarity index 98% rename from Finch/Security/CaptchaOptions.cs rename to mixtape/Security/CaptchaOptions.cs index 4159171d..9eb3679e 100644 --- a/Finch/Security/CaptchaOptions.cs +++ b/mixtape/Security/CaptchaOptions.cs @@ -1,6 +1,6 @@ using PowCapServer; -namespace Finch.Security; +namespace Mixtape.Security; public class CaptchaOptions : PowCapConfig { diff --git a/Finch/Security/CaptchaTagHelper.cs b/mixtape/Security/CaptchaTagHelper.cs similarity index 97% rename from Finch/Security/CaptchaTagHelper.cs rename to mixtape/Security/CaptchaTagHelper.cs index bcf345a1..465b1a0e 100644 --- a/Finch/Security/CaptchaTagHelper.cs +++ b/mixtape/Security/CaptchaTagHelper.cs @@ -2,9 +2,9 @@ using Microsoft.AspNetCore.Mvc.ViewFeatures; using Microsoft.AspNetCore.Razor.TagHelpers; using Microsoft.Extensions.Options; -using Finch.Security; +using Mixtape.Security; -namespace Finch.TagHelpers; +namespace Mixtape.TagHelpers; [HtmlTargetElement("app-captcha", TagStructure = TagStructure.NormalOrSelfClosing)] public class CaptchaTagHelper(IOptionsMonitor options) : TagHelper diff --git a/Finch/Security/CaptchaValidator.cs b/mixtape/Security/CaptchaValidator.cs similarity index 96% rename from Finch/Security/CaptchaValidator.cs rename to mixtape/Security/CaptchaValidator.cs index b812b286..be521668 100644 --- a/Finch/Security/CaptchaValidator.cs +++ b/mixtape/Security/CaptchaValidator.cs @@ -2,7 +2,7 @@ using FluentValidation.Validators; using PowCapServer.Abstractions; -namespace Finch.Security; +namespace Mixtape.Security; public sealed class CaptchaValidator : AsyncPropertyValidator { diff --git a/Finch/Security/FinchSecurityModule.cs b/mixtape/Security/MixtapeSecurityModule.cs similarity index 88% rename from Finch/Security/FinchSecurityModule.cs rename to mixtape/Security/MixtapeSecurityModule.cs index 29bd765e..c63f1ae7 100644 --- a/Finch/Security/FinchSecurityModule.cs +++ b/mixtape/Security/MixtapeSecurityModule.cs @@ -14,13 +14,13 @@ using Microsoft.Extensions.Options; using PowCapServer; using PowCapServer.Abstractions; -namespace Finch.Security; +namespace Mixtape.Security; -internal class FinchSecurityModule : FinchModule +internal class MixtapeSecurityModule : MixtapeModule { public override void ConfigureServices(IServiceCollection services, IConfiguration configuration) { - IConfigurationSection captchaSection = configuration.GetSection("Finch:Captcha"); + IConfigurationSection captchaSection = configuration.GetSection("Mixtape:Captcha"); services.TryAddSingleton(); services.TryAddSingleton(); @@ -32,12 +32,12 @@ internal class FinchSecurityModule : FinchModule services.AddSingleton>(s => { ILoggerFactory loggerFactory = s.GetService() ?? NullLoggerFactory.Instance; - FinchOptions finchOptions = s.GetService>().Value; + MixtapeOptions mixtapeOptions = s.GetService>().Value; string contentRootPath = s.GetService().ContentRootPath; return new ConfigureOptions(options => { - string keyPath = Path.GetFullPath(Path.Combine(contentRootPath, finchOptions.DataProtectionStoragePath)); + string keyPath = Path.GetFullPath(Path.Combine(contentRootPath, mixtapeOptions.DataProtectionStoragePath)); options.XmlRepository = new FileSystemXmlRepository(new DirectoryInfo(keyPath), loggerFactory); }); }); diff --git a/Finch/Security/NameAndIdProviderCopy.cs b/mixtape/Security/NameAndIdProviderCopy.cs similarity index 99% rename from Finch/Security/NameAndIdProviderCopy.cs rename to mixtape/Security/NameAndIdProviderCopy.cs index 27ec9426..4443af1d 100644 --- a/Finch/Security/NameAndIdProviderCopy.cs +++ b/mixtape/Security/NameAndIdProviderCopy.cs @@ -1,7 +1,7 @@ using Microsoft.AspNetCore.Mvc.Rendering; using Microsoft.AspNetCore.Mvc.ViewFeatures; -namespace Finch.Security; +namespace Mixtape.Security; /// /// Provides cached values for "name" and "id" HTML attributes. diff --git a/Finch/Security/StaticCaptchaService.cs b/mixtape/Security/StaticCaptchaService.cs similarity index 92% rename from Finch/Security/StaticCaptchaService.cs rename to mixtape/Security/StaticCaptchaService.cs index 2fab67be..9cbe8591 100644 --- a/Finch/Security/StaticCaptchaService.cs +++ b/mixtape/Security/StaticCaptchaService.cs @@ -1,7 +1,7 @@ using Microsoft.Extensions.DependencyInjection; using PowCapServer.Abstractions; -namespace Finch.Security; +namespace Mixtape.Security; internal static class StaticCaptchaService { diff --git a/Finch/Security/ValidatorExtensions.cs b/mixtape/Security/ValidatorExtensions.cs similarity index 85% rename from Finch/Security/ValidatorExtensions.cs rename to mixtape/Security/ValidatorExtensions.cs index 79655722..841fadd8 100644 --- a/Finch/Security/ValidatorExtensions.cs +++ b/mixtape/Security/ValidatorExtensions.cs @@ -1,7 +1,7 @@ using FluentValidation; -using Finch.Security; +using Mixtape.Security; -namespace Finch.Validation; +namespace Mixtape.Validation; public static partial class ValidatorExtensions { diff --git a/mixtape/ServiceCollectionExtensions.cs b/mixtape/ServiceCollectionExtensions.cs new file mode 100644 index 00000000..108a5611 --- /dev/null +++ b/mixtape/ServiceCollectionExtensions.cs @@ -0,0 +1,17 @@ +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; + +namespace Mixtape; + +public static class ServiceCollectionExtensions +{ + public static MixtapeBuilder AddMixtape(this IServiceCollection services, IConfiguration configuration) + { + return new MixtapeBuilder(services, configuration, null); + } + + public static MixtapeBuilder AddMixtape(this IServiceCollection services, IConfiguration configuration, Action setupAction) + { + return new MixtapeBuilder(services, configuration, setupAction); + } +} \ No newline at end of file diff --git a/Finch/TagHelpers/ActiveTagHelper.cs b/mixtape/TagHelpers/ActiveTagHelper.cs similarity index 97% rename from Finch/TagHelpers/ActiveTagHelper.cs rename to mixtape/TagHelpers/ActiveTagHelper.cs index 166e8196..c830a4c3 100644 --- a/Finch/TagHelpers/ActiveTagHelper.cs +++ b/mixtape/TagHelpers/ActiveTagHelper.cs @@ -3,7 +3,7 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc.TagHelpers; using Microsoft.AspNetCore.Razor.TagHelpers; -namespace Finch.TagHelpers; +namespace Mixtape.TagHelpers; [HtmlTargetElement(Attributes = "app-active")] public class ActiveTagHelper(IHttpContextAccessor contextAccessor) : TagHelper diff --git a/Finch/TagHelpers/ClassTagHelper.cs b/mixtape/TagHelpers/ClassTagHelper.cs similarity index 96% rename from Finch/TagHelpers/ClassTagHelper.cs rename to mixtape/TagHelpers/ClassTagHelper.cs index 1bc392ca..4bd95db8 100644 --- a/Finch/TagHelpers/ClassTagHelper.cs +++ b/mixtape/TagHelpers/ClassTagHelper.cs @@ -2,7 +2,7 @@ using Microsoft.AspNetCore.Mvc.TagHelpers; using Microsoft.AspNetCore.Razor.TagHelpers; -namespace Finch.TagHelpers; +namespace Mixtape.TagHelpers; [HtmlTargetElement(Attributes = Prefix + "*")] public class ClassTagHelper : TagHelper diff --git a/Finch/TagHelpers/IconTagHelper.cs b/mixtape/TagHelpers/IconTagHelper.cs similarity index 99% rename from Finch/TagHelpers/IconTagHelper.cs rename to mixtape/TagHelpers/IconTagHelper.cs index 32eeb809..77df3c7c 100644 --- a/Finch/TagHelpers/IconTagHelper.cs +++ b/mixtape/TagHelpers/IconTagHelper.cs @@ -4,7 +4,7 @@ using Microsoft.AspNetCore.Razor.TagHelpers; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; -namespace Finch.TagHelpers; +namespace Mixtape.TagHelpers; [HtmlTargetElement("app-icon", TagStructure = TagStructure.NormalOrSelfClosing)] public class IconTagHelper : TagHelper diff --git a/Finch/TagHelpers/IfTagHelper.cs b/mixtape/TagHelpers/IfTagHelper.cs similarity index 91% rename from Finch/TagHelpers/IfTagHelper.cs rename to mixtape/TagHelpers/IfTagHelper.cs index 3907c808..2e473ed6 100644 --- a/Finch/TagHelpers/IfTagHelper.cs +++ b/mixtape/TagHelpers/IfTagHelper.cs @@ -1,6 +1,6 @@ using Microsoft.AspNetCore.Razor.TagHelpers; -namespace Finch.TagHelpers; +namespace Mixtape.TagHelpers; [HtmlTargetElement(Attributes = "app-if")] public class IfTagHelper : TagHelper diff --git a/Finch/TagHelpers/MultilineTagHelper.cs b/mixtape/TagHelpers/MultilineTagHelper.cs similarity index 93% rename from Finch/TagHelpers/MultilineTagHelper.cs rename to mixtape/TagHelpers/MultilineTagHelper.cs index 3275d967..384e665a 100644 --- a/Finch/TagHelpers/MultilineTagHelper.cs +++ b/mixtape/TagHelpers/MultilineTagHelper.cs @@ -1,6 +1,6 @@ using Microsoft.AspNetCore.Razor.TagHelpers; -namespace Finch.TagHelpers; +namespace Mixtape.TagHelpers; [HtmlTargetElement("app-multiline", Attributes = "text")] public class MultilineTagHelper : TagHelper diff --git a/Finch/TagHelpers/ResizeTagHelper.cs b/mixtape/TagHelpers/ResizeTagHelper.cs similarity index 98% rename from Finch/TagHelpers/ResizeTagHelper.cs rename to mixtape/TagHelpers/ResizeTagHelper.cs index 8b480b84..a79ea37d 100644 --- a/Finch/TagHelpers/ResizeTagHelper.cs +++ b/mixtape/TagHelpers/ResizeTagHelper.cs @@ -2,7 +2,7 @@ using Microsoft.AspNetCore.Mvc.ViewFeatures; using Microsoft.AspNetCore.Razor.TagHelpers; -namespace Finch.TagHelpers; +namespace Mixtape.TagHelpers; [HtmlTargetElement(Attributes = "app-resize")] public class ResizeTagHelper : TagHelper diff --git a/Finch/TagHelpers/StripHtmlTagHelper.cs b/mixtape/TagHelpers/StripHtmlTagHelper.cs similarity index 96% rename from Finch/TagHelpers/StripHtmlTagHelper.cs rename to mixtape/TagHelpers/StripHtmlTagHelper.cs index f79ca471..d767820c 100644 --- a/Finch/TagHelpers/StripHtmlTagHelper.cs +++ b/mixtape/TagHelpers/StripHtmlTagHelper.cs @@ -2,7 +2,7 @@ using System.Net; using static System.Text.RegularExpressions.Regex; -namespace Finch.TagHelpers; +namespace Mixtape.TagHelpers; [HtmlTargetElement("app-striphtml", Attributes = "text")] public class StripHtmlTagHelper : TagHelper diff --git a/mixtape/Usings.cs b/mixtape/Usings.cs new file mode 100644 index 00000000..fa7945c0 --- /dev/null +++ b/mixtape/Usings.cs @@ -0,0 +1,22 @@ + +global using System; +global using System.Collections; +global using System.Collections.Generic; +global using System.Linq; +global using System.Threading; +global using System.Threading.Tasks; + +//global using Mixtape.Persistence; +global using Mixtape.Utils; +global using Mixtape.Configuration; +global using Mixtape.Extensions; +global using Mixtape.FileStorage; +global using Mixtape.Models; +global using Mixtape.Modules; +global using Mixtape.Media; +global using Mixtape.Rendering; +global using Mixtape.Validation; +global using Mixtape.Localization; +global using Mixtape.Context; +global using Mixtape.Communication; +global using Mixtape.Assemblies; diff --git a/Finch/Utils/Base32.cs b/mixtape/Utils/Base32.cs similarity index 99% rename from Finch/Utils/Base32.cs rename to mixtape/Utils/Base32.cs index 0d7edb62..5cac46f7 100644 --- a/Finch/Utils/Base32.cs +++ b/mixtape/Utils/Base32.cs @@ -1,6 +1,6 @@ using System.Text; -namespace Finch.Utils; +namespace Mixtape.Utils; // This is a re-implementation of ASP.NET Core Base32, as they have marked it as internal // by using this we can create user security stamps on the fly and don't need diff --git a/Finch/Utils/DateRange.cs b/mixtape/Utils/DateRange.cs similarity index 96% rename from Finch/Utils/DateRange.cs rename to mixtape/Utils/DateRange.cs index f5cec28e..a25fa9f4 100644 --- a/Finch/Utils/DateRange.cs +++ b/mixtape/Utils/DateRange.cs @@ -1,4 +1,4 @@ -namespace Finch.Utils; +namespace Mixtape.Utils; public class DateRange { diff --git a/Finch/Utils/GenerateIdAttribute.cs b/mixtape/Utils/GenerateIdAttribute.cs similarity index 93% rename from Finch/Utils/GenerateIdAttribute.cs rename to mixtape/Utils/GenerateIdAttribute.cs index c14ccd52..e6cfb94e 100644 --- a/Finch/Utils/GenerateIdAttribute.cs +++ b/mixtape/Utils/GenerateIdAttribute.cs @@ -1,4 +1,4 @@ -namespace Finch.Utils; +namespace Mixtape.Utils; /// /// Automatically generate ID with the specified length and insert it into this property on entity save diff --git a/Finch/Utils/IdGenerator.cs b/mixtape/Utils/IdGenerator.cs similarity index 99% rename from Finch/Utils/IdGenerator.cs rename to mixtape/Utils/IdGenerator.cs index e18bc8c1..dbe91a3d 100644 --- a/Finch/Utils/IdGenerator.cs +++ b/mixtape/Utils/IdGenerator.cs @@ -1,6 +1,6 @@ using System.Text.Json; -namespace Finch.Utils; +namespace Mixtape.Utils; public class IdGenerator { diff --git a/Finch/Utils/JsonDiscriminatorConverter.cs b/mixtape/Utils/JsonDiscriminatorConverter.cs similarity index 98% rename from Finch/Utils/JsonDiscriminatorConverter.cs rename to mixtape/Utils/JsonDiscriminatorConverter.cs index c0c2e7a2..67a2bace 100644 --- a/Finch/Utils/JsonDiscriminatorConverter.cs +++ b/mixtape/Utils/JsonDiscriminatorConverter.cs @@ -1,7 +1,7 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Finch.Utils; +namespace Mixtape.Utils; public abstract class JsonDiscriminatorConverter : JsonConverter where T : class, new() { diff --git a/Finch/Utils/ObjectCopycat.cs b/mixtape/Utils/ObjectCopycat.cs similarity index 99% rename from Finch/Utils/ObjectCopycat.cs rename to mixtape/Utils/ObjectCopycat.cs index a222ee45..ec5ef322 100644 --- a/Finch/Utils/ObjectCopycat.cs +++ b/mixtape/Utils/ObjectCopycat.cs @@ -2,7 +2,7 @@ using System.Reflection; using System.Text.Json; -namespace Finch.Utils; +namespace Mixtape.Utils; public class ObjectCopycat { diff --git a/Finch/Utils/ObjectTraverser.cs b/mixtape/Utils/ObjectTraverser.cs similarity index 99% rename from Finch/Utils/ObjectTraverser.cs rename to mixtape/Utils/ObjectTraverser.cs index 82ac589b..aff65642 100644 --- a/Finch/Utils/ObjectTraverser.cs +++ b/mixtape/Utils/ObjectTraverser.cs @@ -1,6 +1,6 @@ using System.Reflection; -namespace Finch.Utils; +namespace Mixtape.Utils; public class ObjectTraverser { diff --git a/Finch/Utils/PasswordGenerator.cs b/mixtape/Utils/PasswordGenerator.cs similarity index 94% rename from Finch/Utils/PasswordGenerator.cs rename to mixtape/Utils/PasswordGenerator.cs index ccc09ecd..3a03b990 100644 --- a/Finch/Utils/PasswordGenerator.cs +++ b/mixtape/Utils/PasswordGenerator.cs @@ -1,4 +1,4 @@ -namespace Finch.Utils; +namespace Mixtape.Utils; public class PasswordGenerator { diff --git a/Finch/Utils/PriceRange.cs b/mixtape/Utils/PriceRange.cs similarity index 78% rename from Finch/Utils/PriceRange.cs rename to mixtape/Utils/PriceRange.cs index 74176187..ce3def58 100644 --- a/Finch/Utils/PriceRange.cs +++ b/mixtape/Utils/PriceRange.cs @@ -1,4 +1,4 @@ -namespace Finch.Utils; +namespace Mixtape.Utils; public class PriceRange { diff --git a/Finch/Utils/PrimitiveTypeCollection.cs b/mixtape/Utils/PrimitiveTypeCollection.cs similarity index 98% rename from Finch/Utils/PrimitiveTypeCollection.cs rename to mixtape/Utils/PrimitiveTypeCollection.cs index 46438745..48c2a09d 100644 --- a/Finch/Utils/PrimitiveTypeCollection.cs +++ b/mixtape/Utils/PrimitiveTypeCollection.cs @@ -1,6 +1,6 @@ using System.Collections.Concurrent; -namespace Finch.Utils; +namespace Mixtape.Utils; public class PrimitiveTypeCollection : ConcurrentDictionary, IPrimitiveTypeCollection { diff --git a/Finch/Utils/Safenames.cs b/mixtape/Utils/Safenames.cs similarity index 99% rename from Finch/Utils/Safenames.cs rename to mixtape/Utils/Safenames.cs index 0f9ffe9c..116979a5 100644 --- a/Finch/Utils/Safenames.cs +++ b/mixtape/Utils/Safenames.cs @@ -1,7 +1,7 @@ using System.IO; using System.Text; -namespace Finch.Utils; +namespace Mixtape.Utils; public class Safenames { diff --git a/Finch/Utils/TokenReplacement.cs b/mixtape/Utils/TokenReplacement.cs similarity index 97% rename from Finch/Utils/TokenReplacement.cs rename to mixtape/Utils/TokenReplacement.cs index 9d272f76..c54d275d 100644 --- a/Finch/Utils/TokenReplacement.cs +++ b/mixtape/Utils/TokenReplacement.cs @@ -1,6 +1,6 @@ using System.Text.RegularExpressions; -namespace Finch.Utils; +namespace Mixtape.Utils; public class TokenReplacement { diff --git a/Finch/Validation/German/FluentValidationEnglishLanguage.cs b/mixtape/Validation/German/FluentValidationEnglishLanguage.cs similarity index 90% rename from Finch/Validation/German/FluentValidationEnglishLanguage.cs rename to mixtape/Validation/German/FluentValidationEnglishLanguage.cs index eb741c3d..7b0f5a6a 100644 --- a/Finch/Validation/German/FluentValidationEnglishLanguage.cs +++ b/mixtape/Validation/German/FluentValidationEnglishLanguage.cs @@ -1,4 +1,4 @@ -namespace Finch.Validation; +namespace Mixtape.Validation; public class FluentValidationEnglishLanguage { diff --git a/Finch/Validation/German/FluentValidationGermanLanguage.cs b/mixtape/Validation/German/FluentValidationGermanLanguage.cs similarity index 98% rename from Finch/Validation/German/FluentValidationGermanLanguage.cs rename to mixtape/Validation/German/FluentValidationGermanLanguage.cs index 5e622849..038882b6 100644 --- a/Finch/Validation/German/FluentValidationGermanLanguage.cs +++ b/mixtape/Validation/German/FluentValidationGermanLanguage.cs @@ -1,4 +1,4 @@ -namespace Finch.Validation; +namespace Mixtape.Validation; public class FluentValidationGermanLanguage { diff --git a/Finch/Validation/German/GermanIdentityErrorDescriber.cs b/mixtape/Validation/German/GermanIdentityErrorDescriber.cs similarity index 99% rename from Finch/Validation/German/GermanIdentityErrorDescriber.cs rename to mixtape/Validation/German/GermanIdentityErrorDescriber.cs index c121c09e..aa116084 100644 --- a/Finch/Validation/German/GermanIdentityErrorDescriber.cs +++ b/mixtape/Validation/German/GermanIdentityErrorDescriber.cs @@ -1,6 +1,6 @@ using Microsoft.AspNetCore.Identity; -namespace Finch.Validation; +namespace Mixtape.Validation; public class GermanIdentityErrorDescriber : IdentityErrorDescriber { diff --git a/Finch/Validation/German/ServiceCollectionExtensions.cs b/mixtape/Validation/German/ServiceCollectionExtensions.cs similarity index 97% rename from Finch/Validation/German/ServiceCollectionExtensions.cs rename to mixtape/Validation/German/ServiceCollectionExtensions.cs index c12b7dee..d7fa8a5a 100644 --- a/Finch/Validation/German/ServiceCollectionExtensions.cs +++ b/mixtape/Validation/German/ServiceCollectionExtensions.cs @@ -3,7 +3,7 @@ using FluentValidation.Resources; using Microsoft.AspNetCore.Identity; using Microsoft.Extensions.DependencyInjection; -namespace Finch.Validation; +namespace Mixtape.Validation; public static class ServiceCollectionExtensions { diff --git a/Finch/Validation/FinchMergedValidator.cs b/mixtape/Validation/MixtapeMergedValidator.cs similarity index 77% rename from Finch/Validation/FinchMergedValidator.cs rename to mixtape/Validation/MixtapeMergedValidator.cs index a5857378..02ad28f3 100644 --- a/Finch/Validation/FinchMergedValidator.cs +++ b/mixtape/Validation/MixtapeMergedValidator.cs @@ -2,16 +2,16 @@ using FluentValidation.Results; using System.Collections.Concurrent; -namespace Finch.Validation; +namespace Mixtape.Validation; -public class FinchMergedValidator : IFinchMergedValidator +public class MixtapeMergedValidator : IMixtapeMergedValidator { protected IEnumerable> Validators { get; } ConcurrentDictionary>> TypeCache = new(); - public FinchMergedValidator(IEnumerable> validators) + public MixtapeMergedValidator(IEnumerable> validators) { Validators = validators; } @@ -53,7 +53,7 @@ public class FinchMergedValidator : IFinchMergedValidator bool CanHandle(IValidator validator, Type modelType) { Type validatorType = validator.GetType(); - Type typeToFind = typeof(FinchValidator<,>); + Type typeToFind = typeof(MixtapeValidator<,>); Type findValidatorBase(Type type) { @@ -70,21 +70,21 @@ public class FinchMergedValidator : IFinchMergedValidator return findValidatorBase(type.BaseType); } - Type finchValidatorType = findValidatorBase(validatorType); + Type mixtapeValidatorType = findValidatorBase(validatorType); - if (finchValidatorType == null) + if (mixtapeValidatorType == null) { return false; } - Type implementationType = finchValidatorType.GenericTypeArguments[1]; + Type implementationType = mixtapeValidatorType.GenericTypeArguments[1]; return implementationType.IsAssignableFrom(modelType); } } -public interface IFinchMergedValidator +public interface IMixtapeMergedValidator { /// /// Get all validators which can run for the given model @@ -92,7 +92,7 @@ public interface IFinchMergedValidator IEnumerable> ResolveFor(T model); /// - /// Validates a model by using all registered FinchValidators for this entity type + /// Validates a model by using all registered MixtapeValidators for this entity type /// Task ValidateAsync(T model); } \ No newline at end of file diff --git a/Finch/Validation/FinchValidationModule.cs b/mixtape/Validation/MixtapeValidationModule.cs similarity index 58% rename from Finch/Validation/FinchValidationModule.cs rename to mixtape/Validation/MixtapeValidationModule.cs index 56934986..9f00a47c 100644 --- a/Finch/Validation/FinchValidationModule.cs +++ b/mixtape/Validation/MixtapeValidationModule.cs @@ -1,13 +1,13 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; -namespace Finch.Validation; +namespace Mixtape.Validation; -internal class FinchValidationModule : FinchModule +internal class MixtapeValidationModule : MixtapeModule { public override void ConfigureServices(IServiceCollection services, IConfiguration configuration) { services.AddValidationLanguageExtensions(); - services.AddScoped(typeof(IFinchMergedValidator<>), typeof(FinchMergedValidator<>)); + services.AddScoped(typeof(IMixtapeMergedValidator<>), typeof(MixtapeMergedValidator<>)); } } \ No newline at end of file diff --git a/Finch/Validation/FinchValidator.cs b/mixtape/Validation/MixtapeValidator.cs similarity index 71% rename from Finch/Validation/FinchValidator.cs rename to mixtape/Validation/MixtapeValidator.cs index 61a59e37..b8a722e8 100644 --- a/Finch/Validation/FinchValidator.cs +++ b/mixtape/Validation/MixtapeValidator.cs @@ -1,13 +1,13 @@ using FluentValidation; using FluentValidation.Results; -namespace Finch.Validation; +namespace Mixtape.Validation; -public class FinchValidator : FinchValidator +public class MixtapeValidator : MixtapeValidator { } -public abstract class FinchValidator : AbstractValidator, IValidator where TImplementation : TInterface +public abstract class MixtapeValidator : AbstractValidator, IValidator where TImplementation : TInterface { public ValidationResult Validate(TInterface instance) { diff --git a/Finch/Validation/ModelStateDictionaryExtensions.cs b/mixtape/Validation/ModelStateDictionaryExtensions.cs similarity index 99% rename from Finch/Validation/ModelStateDictionaryExtensions.cs rename to mixtape/Validation/ModelStateDictionaryExtensions.cs index 67b7201f..bf538e1c 100644 --- a/Finch/Validation/ModelStateDictionaryExtensions.cs +++ b/mixtape/Validation/ModelStateDictionaryExtensions.cs @@ -2,7 +2,7 @@ using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Mvc.ModelBinding; -namespace Finch.Validation; +namespace Mixtape.Validation; public static class ModelStateDictionaryExtensions { diff --git a/Finch/Validation/ValidatorCamelCasePropertyResolver.cs b/mixtape/Validation/ValidatorCamelCasePropertyResolver.cs similarity index 95% rename from Finch/Validation/ValidatorCamelCasePropertyResolver.cs rename to mixtape/Validation/ValidatorCamelCasePropertyResolver.cs index ddf87f90..0525319a 100644 --- a/Finch/Validation/ValidatorCamelCasePropertyResolver.cs +++ b/mixtape/Validation/ValidatorCamelCasePropertyResolver.cs @@ -2,7 +2,7 @@ using System.Linq.Expressions; using System.Reflection; -namespace Finch.Validation; +namespace Mixtape.Validation; public class ValidatorCamelCasePropertyResolver { diff --git a/Finch/Validation/ValidatorExtensions.cs b/mixtape/Validation/ValidatorExtensions.cs similarity index 95% rename from Finch/Validation/ValidatorExtensions.cs rename to mixtape/Validation/ValidatorExtensions.cs index 6bf0a738..f17f7619 100644 --- a/Finch/Validation/ValidatorExtensions.cs +++ b/mixtape/Validation/ValidatorExtensions.cs @@ -1,7 +1,7 @@ using FluentValidation; -using Finch.Validation.Validators; +using Mixtape.Validation.Validators; -namespace Finch.Validation; +namespace Mixtape.Validation; public static partial class ValidatorExtensions { diff --git a/Finch/Validation/Validators/CultureValidator.cs b/mixtape/Validation/Validators/CultureValidator.cs similarity index 94% rename from Finch/Validation/Validators/CultureValidator.cs rename to mixtape/Validation/Validators/CultureValidator.cs index 5a1b6858..a2f7cc6c 100644 --- a/Finch/Validation/Validators/CultureValidator.cs +++ b/mixtape/Validation/Validators/CultureValidator.cs @@ -1,7 +1,7 @@ using FluentValidation.Validators; using System.Globalization; -namespace Finch.Validation.Validators; +namespace Mixtape.Validation.Validators; public class CultureValidator : PropertyValidator { diff --git a/Finch/Validation/Validators/EmailValidator.cs b/mixtape/Validation/Validators/EmailValidator.cs similarity index 95% rename from Finch/Validation/Validators/EmailValidator.cs rename to mixtape/Validation/Validators/EmailValidator.cs index 0178541a..66356de6 100644 --- a/Finch/Validation/Validators/EmailValidator.cs +++ b/mixtape/Validation/Validators/EmailValidator.cs @@ -1,7 +1,7 @@ using FluentValidation.Validators; using System.Net.Mail; -namespace Finch.Validation.Validators; +namespace Mixtape.Validation.Validators; public class EmailValidator : PropertyValidator, IEmailValidator { diff --git a/Finch/Validation/Validators/EmailsValidator.cs b/mixtape/Validation/Validators/EmailsValidator.cs similarity index 94% rename from Finch/Validation/Validators/EmailsValidator.cs rename to mixtape/Validation/Validators/EmailsValidator.cs index e9399b9d..e9f9c945 100644 --- a/Finch/Validation/Validators/EmailsValidator.cs +++ b/mixtape/Validation/Validators/EmailsValidator.cs @@ -1,6 +1,6 @@ using FluentValidation.Validators; -namespace Finch.Validation.Validators; +namespace Mixtape.Validation.Validators; public class EmailsValidator : PropertyValidator, IEmailValidator { diff --git a/Finch/Validation/Validators/HexValidator.cs b/mixtape/Validation/Validators/HexValidator.cs similarity index 86% rename from Finch/Validation/Validators/HexValidator.cs rename to mixtape/Validation/Validators/HexValidator.cs index a1c2a79a..cc13a666 100644 --- a/Finch/Validation/Validators/HexValidator.cs +++ b/mixtape/Validation/Validators/HexValidator.cs @@ -1,6 +1,6 @@ using System.Text.RegularExpressions; -namespace Finch.Validation.Validators; +namespace Mixtape.Validation.Validators; public class HexValidator : RegexValidator { diff --git a/Finch/Validation/Validators/RegexValidator.cs b/mixtape/Validation/Validators/RegexValidator.cs similarity index 95% rename from Finch/Validation/Validators/RegexValidator.cs rename to mixtape/Validation/Validators/RegexValidator.cs index 54171946..b8294ed1 100644 --- a/Finch/Validation/Validators/RegexValidator.cs +++ b/mixtape/Validation/Validators/RegexValidator.cs @@ -1,7 +1,7 @@ using FluentValidation.Validators; using System.Text.RegularExpressions; -namespace Finch.Validation.Validators; +namespace Mixtape.Validation.Validators; public abstract class RegexValidator : PropertyValidator { diff --git a/Finch/Validation/Validators/UrlValidator.cs b/mixtape/Validation/Validators/UrlValidator.cs similarity index 91% rename from Finch/Validation/Validators/UrlValidator.cs rename to mixtape/Validation/Validators/UrlValidator.cs index 06745f52..5c0eabfc 100644 --- a/Finch/Validation/Validators/UrlValidator.cs +++ b/mixtape/Validation/Validators/UrlValidator.cs @@ -1,6 +1,6 @@ using FluentValidation.Validators; -namespace Finch.Validation.Validators; +namespace Mixtape.Validation.Validators; public class UrlValidator : PropertyValidator { diff --git a/Finch/Finch.csproj b/mixtape/mixtape.csproj similarity index 76% rename from Finch/Finch.csproj rename to mixtape/mixtape.csproj index 10d84832..781b2111 100644 --- a/Finch/Finch.csproj +++ b/mixtape/mixtape.csproj @@ -1,11 +1,11 @@ - Finch + Mixtape 1.0.0 net8.0;net9.0;net10.0 true - Finch + Mixtape embedded @@ -27,8 +27,8 @@ - - + + \ No newline at end of file