Deprecate services and update mapping profiles
- Added obsolete attributes to `AuthController`, `ModuleController`, and various mapping profiles, recommending the use of MediatR and DigitalData.Core.Exceptions. - Updated `User` class to use `required` keyword for `DateFormat` in .NET 7.0 or greater. - Marked methods in `Extensions` and `AddUserManagerInfrastructure` as obsolete, suggesting the use of IRepository. - Adjusted import statements in `DependencyInjection.cs` and marked `GroupOfUserRepository` and `ModuleRepository` as obsolete, recommending a Repository pattern.
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
using DigitalData.UserManager.Application;
|
||||
using DigitalData.UserManager.Application.Contracts.Repositories;
|
||||
using DigitalData.UserManager.Application.Contracts.Repositories;
|
||||
using DigitalData.UserManager.Infrastructure.Contracts;
|
||||
using DigitalData.UserManager.Infrastructure.Repositories;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
@@ -37,7 +36,8 @@ public static class DependencyInjection
|
||||
/// <param name="services">The <see cref="IServiceCollection"/> to which the services will be added.</param>
|
||||
/// <param name="optionsAction">An <see cref="Action{T}"/> to configure the <see cref="DbContextOptionsBuilder"/>.</param>
|
||||
/// <returns>The updated <see cref="IServiceCollection"/>.</returns>
|
||||
[Obsolete("Use IRepository")]
|
||||
public static IServiceCollection AddUserManagerInfrastructure(this IServiceCollection services, Action<DbContextOptionsBuilder> optionsAction) => services
|
||||
.AddDbContext<UserManagerDbContext>(optionsAction)
|
||||
.AddUserManagerInfrastructure<UserManagerDbContext>();
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ using DigitalData.UserManager.Application.Contracts.Repositories;
|
||||
|
||||
namespace DigitalData.UserManager.Infrastructure.Repositories
|
||||
{
|
||||
[Obsolete("Use Repository")]
|
||||
public class GroupOfUserRepository<TDbContext> : CRUDRepository<GroupOfUser, int, TDbContext>, IGroupOfUserRepository
|
||||
where TDbContext : DbContext, IUserManagerDbContext
|
||||
{
|
||||
|
||||
@@ -6,6 +6,7 @@ using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace DigitalData.UserManager.Infrastructure.Repositories;
|
||||
|
||||
[Obsolete("Use Repository")]
|
||||
public class ModuleRepository<TDbContext> : CRUDRepository<Module, int, TDbContext>, IModuleRepository
|
||||
where TDbContext : DbContext, IUserManagerDbContext
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user