Compare commits
5 Commits
b1075c8b82
...
53bfc4a413
| Author | SHA1 | Date | |
|---|---|---|---|
| 53bfc4a413 | |||
| 3de7e64f85 | |||
| 39a9181257 | |||
| 5d3f73bb13 | |||
| bc44de63ee |
@ -13,6 +13,7 @@ namespace DigitalData.UserManager.API.Controllers;
|
||||
[ApiController]
|
||||
public class AuthController : ControllerBase
|
||||
{
|
||||
[Obsolete("Use MediatR")]
|
||||
private readonly ILogger<UserController> _logger;
|
||||
[Obsolete("Use MediatR")]
|
||||
private readonly IUserService _userService;
|
||||
|
||||
@ -7,8 +7,10 @@ using Microsoft.AspNetCore.Authorization;
|
||||
namespace DigitalData.UserManager.API.Controllers;
|
||||
|
||||
[Authorize]
|
||||
[Obsolete("Use MediatR")]
|
||||
public class ModuleController : ReadControllerBaseWithErrorHandling<IModuleService, ModuleDto, Module, int>
|
||||
{
|
||||
[Obsolete("Use MediatR")]
|
||||
public ModuleController(ILogger<ModuleController> logger, IModuleService service) : base(logger, service)
|
||||
{
|
||||
}
|
||||
|
||||
@ -70,7 +70,9 @@ try {
|
||||
// Once the app is built, the password will be decrypted with Encryptor. lazy loading also acts as a call back method.
|
||||
Lazy<string>? cnn_str = null;
|
||||
|
||||
#pragma warning disable CS0618 // Type or member is obsolete
|
||||
builder.Services.AddUserManager(options => options.UseSqlServer(cnn_str!.Value).EnableSensitiveDataLogging());
|
||||
#pragma warning restore CS0618 // Type or member is obsolete
|
||||
|
||||
var allowedOrigins = builder.Configuration.GetSection("AllowedOrigins").Get<string[]>() ?? throw new InvalidOperationException("In appsettings there is no allowed origin.");
|
||||
|
||||
|
||||
@ -16,6 +16,7 @@ namespace DigitalData.UserManager.Application
|
||||
/// <typeparam name="TDbContext">The type of the DbContext to use for the repositories.</typeparam>
|
||||
/// <param name="services">The IServiceCollection to which the services will be added.</param>
|
||||
/// <returns>The updated IServiceCollection.</returns>
|
||||
[Obsolete("Use MediatR")]
|
||||
public static IServiceCollection AddUserManagerApplication(this IServiceCollection services)
|
||||
=> services
|
||||
.AddAutoMapper(typeof(UserMappingProfile).Assembly)
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
|
||||
namespace DigitalData.UserManager.Application.DTOs.Group
|
||||
{
|
||||
[Obsolete("Use DigitalData.Core.Exceptions and .Middleware")]
|
||||
public record GroupReadDto
|
||||
(
|
||||
int Id,
|
||||
|
||||
@ -4,6 +4,7 @@ using DigitalData.UserManager.Application.DTOs.User;
|
||||
|
||||
namespace DigitalData.UserManager.Application.DTOs.GroupOfUser
|
||||
{
|
||||
[Obsolete("Use DigitalData.Core.Exceptions and .Middleware")]
|
||||
public record GroupOfUserReadDto(
|
||||
int Id,
|
||||
int UserId,
|
||||
|
||||
@ -4,6 +4,7 @@ using DigitalData.UserManager.Application.DTOs.User;
|
||||
|
||||
namespace DigitalData.UserManager.Application.DTOs.UserRep
|
||||
{
|
||||
[Obsolete("Use DigitalData.Core.Exceptions and .Middleware")]
|
||||
public record UserRepReadDto(
|
||||
int Id,
|
||||
int? UserId,
|
||||
|
||||
@ -6,6 +6,7 @@ namespace DigitalData.UserManager.Application.MappingProfiles
|
||||
{
|
||||
public class GroupMappingProfile : Profile
|
||||
{
|
||||
[Obsolete("Use DigitalData.Core.Exceptions and .Middleware")]
|
||||
public GroupMappingProfile()
|
||||
{
|
||||
CreateMap<Group, GroupCreateDto>();
|
||||
|
||||
@ -6,6 +6,7 @@ namespace DigitalData.UserManager.Application.MappingProfiles
|
||||
{
|
||||
public class GroupOfUserMappingProfile : Profile
|
||||
{
|
||||
[Obsolete("Use DigitalData.Core.Exceptions and .Middleware")]
|
||||
public GroupOfUserMappingProfile()
|
||||
{
|
||||
CreateMap<GroupOfUser, GroupOfUserCreateDto>();
|
||||
@ -17,4 +18,4 @@ namespace DigitalData.UserManager.Application.MappingProfiles
|
||||
CreateMap<GroupOfUserUpdateDto, GroupOfUser>();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -6,6 +6,7 @@ namespace DigitalData.UserManager.Application.MappingProfiles
|
||||
{
|
||||
public class UserRepMappingProfile : Profile
|
||||
{
|
||||
[Obsolete("Use DigitalData.Core.Exceptions and .Middleware")]
|
||||
public UserRepMappingProfile()
|
||||
{
|
||||
CreateMap<UserRep, UserRepCreateDto>();
|
||||
|
||||
@ -8,6 +8,7 @@ namespace DigitalData.UserManager.DependencyInjection;
|
||||
|
||||
public static class Extensions
|
||||
{
|
||||
[Obsolete("Use IRepository")]
|
||||
public static IServiceCollection AddUserManager<TDbContext>(this IServiceCollection services)
|
||||
where TDbContext : DbContext, IUserManagerDbContext
|
||||
{
|
||||
@ -16,10 +17,11 @@ public static class Extensions
|
||||
return services;
|
||||
}
|
||||
|
||||
[Obsolete("Use MediatR")]
|
||||
public static IServiceCollection AddUserManager(this IServiceCollection services, Action<DbContextOptionsBuilder> optionsAction)
|
||||
{
|
||||
services.AddUserManagerInfrastructure(optionsAction);
|
||||
services.AddUserManagerApplication();
|
||||
return services;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2,8 +2,6 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net462;net7.0;net8.0;net9.0</TargetFrameworks>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<PackageId>UserManager.Domain</PackageId>
|
||||
<Version>3.1.0</Version>
|
||||
<Authors>Digital Data GmbH</Authors>
|
||||
@ -19,11 +17,13 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(TargetFramework)' == 'net462'">
|
||||
<Nullable>disable</Nullable>
|
||||
<ImplicitUsings>disable</ImplicitUsings>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(TargetFramework)' != 'net462'">
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<LangVersion>latest</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
@ -17,20 +17,18 @@ namespace DigitalData.UserManager.Domain.Entities
|
||||
[StringLength(50)]
|
||||
[Column("ADDED_WHO")]
|
||||
public string
|
||||
#if NET6_0_OR_GREATER
|
||||
#if NET7_0_OR_GREATER
|
||||
?
|
||||
#endif
|
||||
AddedWho
|
||||
{ get; set; }
|
||||
AddedWho { get; set; }
|
||||
|
||||
[StringLength(50)]
|
||||
[Column("CHANGED_WHO")]
|
||||
public string
|
||||
#if NET6_0_OR_GREATER
|
||||
#if NET7_0_OR_GREATER
|
||||
?
|
||||
#endif
|
||||
ChangedWho
|
||||
{ get; set; }
|
||||
ChangedWho { get; set; }
|
||||
|
||||
//TODO: assign it to default value in create dto, not here!
|
||||
[Column("ADDED_WHEN", TypeName = "datetime")]
|
||||
|
||||
@ -25,20 +25,18 @@ namespace DigitalData.UserManager.Domain.Entities
|
||||
|
||||
[Column("COMMENT")]
|
||||
public string
|
||||
#if NET6_0_OR_GREATER
|
||||
#if NET7_0_OR_GREATER
|
||||
?
|
||||
#endif
|
||||
Comment
|
||||
{ get; set; }
|
||||
Comment { get; set; }
|
||||
|
||||
[StringLength(50)]
|
||||
[Column("ADDED_WHO")]
|
||||
public string
|
||||
#if NET6_0_OR_GREATER
|
||||
#if NET7_0_OR_GREATER
|
||||
?
|
||||
#endif
|
||||
AddedWho
|
||||
{ get; set; }
|
||||
AddedWho { get; set; }
|
||||
|
||||
[Column("ADDED_WHEN", TypeName = "datetime")]
|
||||
[DefaultValue("GETDATE()")]
|
||||
|
||||
@ -9,7 +9,7 @@ namespace DigitalData.UserManager.Domain.Entities
|
||||
{
|
||||
[StringLength(50)]
|
||||
public string
|
||||
#if NET6_0_OR_GREATER
|
||||
#if NET7_0_OR_GREATER
|
||||
?
|
||||
#endif
|
||||
Name { get; set; }
|
||||
@ -29,11 +29,10 @@ namespace DigitalData.UserManager.Domain.Entities
|
||||
|
||||
[StringLength(200)]
|
||||
public string
|
||||
#if NET6_0_OR_GREATER
|
||||
#if NET7_0_OR_GREATER
|
||||
?
|
||||
#endif
|
||||
Comment
|
||||
{ get; set; }
|
||||
Comment { get; set; }
|
||||
|
||||
// TODO: this column should be assigned by triggers. despite this it is not null and this is problem for creation. talk with others
|
||||
[Required]
|
||||
|
||||
@ -16,21 +16,21 @@ namespace DigitalData.UserManager.Domain.Entities
|
||||
|
||||
[StringLength(200)]
|
||||
public string
|
||||
#if NET6_0_OR_GREATER
|
||||
#if NET7_0_OR_GREATER
|
||||
?
|
||||
#endif
|
||||
Comment { get; set; }
|
||||
|
||||
[ForeignKey("UserId")]
|
||||
public virtual User
|
||||
#if NET6_0_OR_GREATER
|
||||
#if NET7_0_OR_GREATER
|
||||
?
|
||||
#endif
|
||||
User { get; set; }
|
||||
|
||||
[ForeignKey("GroupId")]
|
||||
public virtual Group
|
||||
#if NET6_0_OR_GREATER
|
||||
#if NET7_0_OR_GREATER
|
||||
?
|
||||
#endif
|
||||
Group { get; set; }
|
||||
|
||||
@ -13,7 +13,7 @@ namespace DigitalData.UserManager.Domain.Entities
|
||||
|
||||
[StringLength(50)]
|
||||
public string
|
||||
#if NET6_0_OR_GREATER
|
||||
#if NET7_0_OR_GREATER
|
||||
?
|
||||
#endif
|
||||
Name { get; set; }
|
||||
@ -21,7 +21,7 @@ namespace DigitalData.UserManager.Domain.Entities
|
||||
[StringLength(20)]
|
||||
[Column("SHORT_NAME")]
|
||||
public string
|
||||
#if NET6_0_OR_GREATER
|
||||
#if NET7_0_OR_GREATER
|
||||
?
|
||||
#endif
|
||||
ShortName { get; set; }
|
||||
|
||||
@ -22,7 +22,7 @@ namespace DigitalData.UserManager.Domain.Entities
|
||||
[Column("COMMENT")]
|
||||
[StringLength(200)]
|
||||
public string
|
||||
#if NET6_0_OR_GREATER
|
||||
#if NET7_0_OR_GREATER
|
||||
?
|
||||
#endif
|
||||
Comment { get; set; }
|
||||
@ -30,7 +30,7 @@ namespace DigitalData.UserManager.Domain.Entities
|
||||
[Column("ADDED_WHO")]
|
||||
[StringLength(50)]
|
||||
public string
|
||||
#if NET6_0_OR_GREATER
|
||||
#if NET7_0_OR_GREATER
|
||||
?
|
||||
#endif
|
||||
AddedWho { get; set; } = "DEFAULT";
|
||||
@ -38,21 +38,21 @@ namespace DigitalData.UserManager.Domain.Entities
|
||||
[Column("CHANGED_WHO")]
|
||||
[StringLength(50)]
|
||||
public string
|
||||
#if NET6_0_OR_GREATER
|
||||
#if NET7_0_OR_GREATER
|
||||
?
|
||||
#endif
|
||||
ChangedWho { get; set; }
|
||||
|
||||
[ForeignKey("UserId")]
|
||||
public virtual User
|
||||
#if NET6_0_OR_GREATER
|
||||
#if NET7_0_OR_GREATER
|
||||
?
|
||||
#endif
|
||||
User { get; set; }
|
||||
|
||||
[ForeignKey("ModuleId")]
|
||||
public virtual Module
|
||||
#if NET6_0_OR_GREATER
|
||||
#if NET7_0_OR_GREATER
|
||||
?
|
||||
#endif
|
||||
Module { get; set; }
|
||||
|
||||
@ -10,7 +10,7 @@ namespace DigitalData.UserManager.Domain.Entities
|
||||
[Column("PRENAME")]
|
||||
[StringLength(50)]
|
||||
public string
|
||||
#if NET6_0_OR_GREATER
|
||||
#if NET7_0_OR_GREATER
|
||||
?
|
||||
#endif
|
||||
Prename { get; set; }
|
||||
@ -18,7 +18,7 @@ namespace DigitalData.UserManager.Domain.Entities
|
||||
[Column("NAME")]
|
||||
[StringLength(50)]
|
||||
public string
|
||||
#if NET6_0_OR_GREATER
|
||||
#if NET7_0_OR_GREATER
|
||||
?
|
||||
#endif
|
||||
Name { get; set; }
|
||||
@ -26,12 +26,16 @@ namespace DigitalData.UserManager.Domain.Entities
|
||||
[Required]
|
||||
[Column("USERNAME")]
|
||||
[StringLength(50)]
|
||||
public string Username { get; set; }
|
||||
public
|
||||
#if NET7_0_OR_GREATER
|
||||
required
|
||||
#endif
|
||||
string Username { get; set; }
|
||||
|
||||
[Column("SHORTNAME")]
|
||||
[StringLength(30)]
|
||||
public string
|
||||
#if NET6_0_OR_GREATER
|
||||
#if NET7_0_OR_GREATER
|
||||
?
|
||||
#endif
|
||||
Shortname
|
||||
@ -40,7 +44,7 @@ namespace DigitalData.UserManager.Domain.Entities
|
||||
[Column("EMAIL")]
|
||||
[StringLength(100)]
|
||||
public string
|
||||
#if NET6_0_OR_GREATER
|
||||
#if NET7_0_OR_GREATER
|
||||
?
|
||||
#endif
|
||||
Email { get; set; }
|
||||
@ -50,7 +54,7 @@ namespace DigitalData.UserManager.Domain.Entities
|
||||
[StringLength(5)]
|
||||
[DefaultValue("de-DE")]
|
||||
public string
|
||||
#if NET6_0_OR_GREATER
|
||||
#if NET7_0_OR_GREATER
|
||||
?
|
||||
#endif
|
||||
Language { get; set; }
|
||||
@ -58,7 +62,7 @@ namespace DigitalData.UserManager.Domain.Entities
|
||||
[Column("COMMENT")]
|
||||
[StringLength(500)]
|
||||
public string
|
||||
#if NET6_0_OR_GREATER
|
||||
#if NET7_0_OR_GREATER
|
||||
?
|
||||
#endif
|
||||
Comment { get; set; }
|
||||
@ -70,7 +74,11 @@ namespace DigitalData.UserManager.Domain.Entities
|
||||
[Column("DATE_FORMAT")]
|
||||
[StringLength(10)]
|
||||
[DefaultValue("dd.MM.yyyy")]
|
||||
public string DateFormat { get; set; }
|
||||
public
|
||||
#if NET7_0_OR_GREATER
|
||||
required
|
||||
#endif
|
||||
string DateFormat { get; set; }
|
||||
|
||||
[Required]
|
||||
[Column("ACTIVE")]
|
||||
|
||||
@ -28,28 +28,28 @@ namespace DigitalData.UserManager.Domain.Entities
|
||||
|
||||
[ForeignKey("UserId")]
|
||||
public virtual User
|
||||
#if NET6_0_OR_GREATER
|
||||
#if NET7_0_OR_GREATER
|
||||
?
|
||||
#endif
|
||||
User { get; set; }
|
||||
|
||||
[ForeignKey("RepGroupId")]
|
||||
public virtual Group
|
||||
#if NET6_0_OR_GREATER
|
||||
#if NET7_0_OR_GREATER
|
||||
?
|
||||
#endif
|
||||
RepGroup { get; set; }
|
||||
|
||||
[ForeignKey("GroupId")]
|
||||
public virtual Group
|
||||
#if NET6_0_OR_GREATER
|
||||
#if NET7_0_OR_GREATER
|
||||
?
|
||||
#endif
|
||||
Group { get; set; }
|
||||
|
||||
[ForeignKey("RepUserId")]
|
||||
public virtual User
|
||||
#if NET6_0_OR_GREATER
|
||||
#if NET7_0_OR_GREATER
|
||||
?
|
||||
#endif
|
||||
RepUser { get; set; }
|
||||
|
||||
@ -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;
|
||||
@ -16,6 +15,7 @@ public static class DependencyInjection
|
||||
/// <typeparam name="TDbContext">The type of the DbContext to use for the repositories.</typeparam>
|
||||
/// <param name="services">The IServiceCollection to which the services will be added.</param>
|
||||
/// <returns>The updated IServiceCollection.</returns>
|
||||
[Obsolete("Use IRepository")]
|
||||
public static IServiceCollection AddUserManagerInfrastructure<TDbContext>(this IServiceCollection services)
|
||||
where TDbContext : DbContext, IUserManagerDbContext
|
||||
{
|
||||
@ -36,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.Infrastructure.Contracts;
|
||||
|
||||
namespace DigitalData.UserManager.Infrastructure.Repositories
|
||||
{
|
||||
[Obsolete("Use Repository")]
|
||||
public class ClientUserRepository<TDbContext> : CRUDRepository<ClientUser, int, TDbContext>, IClientUserRepository
|
||||
where TDbContext : DbContext, IUserManagerDbContext
|
||||
{
|
||||
|
||||
@ -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 GroupRepository<TDbContext> : CRUDRepository<Group, int, TDbContext>, IGroupRepository
|
||||
where TDbContext : DbContext, IUserManagerDbContext
|
||||
{
|
||||
|
||||
@ -6,6 +6,7 @@ using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace DigitalData.UserManager.Infrastructure.Repositories;
|
||||
|
||||
[Obsolete("Use Repository")]
|
||||
public class ModuleOfUserRepository<TDbContext> : CRUDRepository<ModuleOfUser, int, TDbContext>, IModuleOfUserRepository
|
||||
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
|
||||
{
|
||||
|
||||
@ -6,6 +6,7 @@ using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace DigitalData.UserManager.Infrastructure.Repositories;
|
||||
|
||||
[Obsolete("Use Repository")]
|
||||
public class UserRepRepository<TDbContext> : CRUDRepository<UserRep, int, TDbContext>, IUserRepRepository
|
||||
where TDbContext : DbContext, IUserManagerDbContext
|
||||
{
|
||||
|
||||
@ -6,6 +6,7 @@ using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace DigitalData.UserManager.Infrastructure.Repositories
|
||||
{
|
||||
[Obsolete("Use Repository")]
|
||||
public class UserRepository<TDbContext> : CRUDRepository<User, int, TDbContext>, IUserRepository
|
||||
where TDbContext : DbContext, IUserManagerDbContext
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user