- 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.
27 lines
970 B
C#
27 lines
970 B
C#
using DigitalData.UserManager.Application;
|
|
using DigitalData.UserManager.Infrastructure;
|
|
using DigitalData.UserManager.Infrastructure.Contracts;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
namespace DigitalData.UserManager.DependencyInjection;
|
|
|
|
public static class Extensions
|
|
{
|
|
[Obsolete("Use IRepository")]
|
|
public static IServiceCollection AddUserManager<TDbContext>(this IServiceCollection services)
|
|
where TDbContext : DbContext, IUserManagerDbContext
|
|
{
|
|
services.AddUserManagerInfrastructure<TDbContext>();
|
|
services.AddUserManagerApplication();
|
|
return services;
|
|
}
|
|
|
|
[Obsolete("Use MediatR")]
|
|
public static IServiceCollection AddUserManager(this IServiceCollection services, Action<DbContextOptionsBuilder> optionsAction)
|
|
{
|
|
services.AddUserManagerInfrastructure(optionsAction);
|
|
services.AddUserManagerApplication();
|
|
return services;
|
|
}
|
|
} |