diff options
author | Yuqian Yang <crupest@crupest.life> | 2025-02-19 02:05:39 +0800 |
---|---|---|
committer | Yuqian Yang <crupest@crupest.life> | 2025-02-19 02:42:42 +0800 |
commit | 4c5df72057fe02257e243de37930a47425a84722 (patch) | |
tree | f782d0e85c4a784b659e0da29f0bbf4fc25fc827 /dropped/docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/CrudServiceCollectionExtensions.cs | |
parent | 89e31c19bb8fca91c54a73ff7a7f4e837d1dbf93 (diff) | |
download | crupest-4c5df72057fe02257e243de37930a47425a84722.tar.gz crupest-4c5df72057fe02257e243de37930a47425a84722.tar.bz2 crupest-4c5df72057fe02257e243de37930a47425a84722.zip |
chore(docker): remove crupest-api, forgejo and move dropped.
Diffstat (limited to 'dropped/docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/CrudServiceCollectionExtensions.cs')
-rw-r--r-- | dropped/docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/CrudServiceCollectionExtensions.cs | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/dropped/docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/CrudServiceCollectionExtensions.cs b/dropped/docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/CrudServiceCollectionExtensions.cs deleted file mode 100644 index a7e5193..0000000 --- a/dropped/docker/crupest-api/CrupestApi/CrupestApi.Commons/Crud/CrudServiceCollectionExtensions.cs +++ /dev/null @@ -1,34 +0,0 @@ -using CrupestApi.Commons.Crud.Migrations; -using CrupestApi.Commons.Secrets; -using Microsoft.Extensions.DependencyInjection.Extensions; - -namespace CrupestApi.Commons.Crud; - -public static class CrudServiceCollectionExtensions -{ - public static IServiceCollection AddCrudCore(this IServiceCollection services) - { - services.TryAddSingleton<IDbConnectionFactory, SqliteConnectionFactory>(); - services.TryAddSingleton<IColumnTypeProvider, ColumnTypeProvider>(); - services.TryAddSingleton<ITableInfoFactory, TableInfoFactory>(); - services.TryAddSingleton<IDatabaseMigrator, SqliteDatabaseMigrator>(); - services.AddSecrets(); - return services; - } - - public static IServiceCollection AddCrud<TEntity, TCrudService>(this IServiceCollection services) where TEntity : class where TCrudService : CrudService<TEntity> - { - AddCrudCore(services); - - services.TryAddScoped<CrudService<TEntity>, TCrudService>(); - services.TryAddScoped<EntityJsonHelper<TEntity>>(); - - return services; - } - - public static IServiceCollection AddCrud<TEntity>(this IServiceCollection services) where TEntity : class - { - return services.AddCrud<TEntity, CrudService<TEntity>>(); - } - -} |