Compare commits

..

26 Commits

Author SHA1 Message Date
0057a2d260 chore: upgrede auf 6.1.1
- Bauort nach \API verschieben
 - AuthClientParams.Url auf 9090 aktualisieren
2025-07-22 17:55:06 +02:00
854db39f30 chore(Domain): update version 2025-07-22 15:50:40 +02:00
f79fa4ca27 fix(auth): Verbesserung von isAuthenticated() durch Überprüfung des HTTP-Antwortstatus
Die isAuthenticated()-Methode wurde aktualisiert, um den Anmeldestatus anhand des HTTP-Antwortstatus zu bestimmen, anstatt sich nur auf den Antwortkörper zu verlassen. Außerdem wird sichergestellt, dass `_isLogedIn` im Fehlerfall explizit auf false gesetzt wird. Dies verbessert die Zuverlässigkeit der Sitzungsvalidierung.
2025-07-22 15:45:38 +02:00
55822047bc refactor(api.models): Verschiebung ins api-Verzeichnis und Vereinfachung der Namenskonvention 2025-07-22 14:21:31 +02:00
de360968dc refactor(User): Aktualisierung des User-Modells. 2025-07-22 14:15:35 +02:00
06303ec2b5 refactor(startup): remove cookie-based authentication configuration 2025-07-22 13:13:52 +02:00
437f33a323 fix(auth): Fehlermeldung bei 401 unauthorized während der Login-Prüfung verhindern
Überspringe die Anzeige der Fehlermeldung in isAuthenticated, wenn der Antwortstatus 401,
ist, was typischerweise anzeigt, dass der Benutzer einfach nicht eingeloggt ist, nicht ein Serverproblem.
2025-07-22 10:33:42 +02:00
963ab12488 chore: add scripts to be able to start without ssl
- changed target of proxy
2025-07-22 10:19:36 +02:00
df24905a0e feat(logging): NLog nur in Nicht-Entwicklungsumgebungen anwenden
Die Einrichtung des Logging-Anbieters wurde mit einer Prüfung versehen, um sicherzustellen, dass NLog nur verwendet wird, wenn es sich nicht in der Entwicklung befindet. Dadurch wird verhindert, dass das Standard-Protokollierungsverhalten während der Entwicklung überschrieben wird.
2025-07-22 08:51:06 +02:00
0659734346 Bump package versions and update User class declaration
Incremented version numbers in DependencyInjection and Domain projects.
Changed User class to partial for better organization and flexibility.
2025-06-26 16:36:24 +02:00
9af19713a0 Bump version numbers for multiple projects
Updated version, AssemblyVersion, and FileVersion for:
- DigitalData.UserManager.API: 6.1.0 to 6.1.1
- DigitalData.UserManager.Application: 3.2.0 to 3.2.1
- DigitalData.UserManager.DependencyInjection: 1.1.0 to 1.1.1
- DigitalData.UserManager.Domain: 3.2.0 to 3.2.1
- DigitalData.UserManager.Infrastructure: 3.1.0 to 3.1.1
2025-06-26 15:48:30 +02:00
06ad3516f1 Enhance User entity with required properties and updates
- Added conditional compilation for .NET Framework.
- Made `GeneralViewer`, `WanEnvironment`, and `DeletedWho` properties required with appropriate attributes.
- Renamed `UseridFkIntEcm` to `UserIdFkIntEcm` and marked it as required.
- Changed `DeletedWhen` to a non-nullable `DateTime`.
- Removed previously ignored columns, activating them in the class definition.
2025-06-26 15:45:22 +02:00
23c7b7a293 Bump version numbers
Updated version, assembly version, and file version for:
- DigitalData.UserManager.API: 6.0.1 to 6.1.0
- DigitalData.UserManager.Application: 3.1.3 to 3.2.0
- DigitalData.UserManager.DependencyInjection: 1.0.0 to 1.1.0
- DigitalData.UserManager.Domain: 3.1.0 to 3.2.0
- DigitalData.UserManager.Infrastructure: 3.0.2 to 3.1.0
2025-06-26 14:02:59 +02:00
53bfc4a413 Suppress warnings for obsolete members and update repo
Added warning suppression in `Program.cs` for obsolete user manager configuration. Marked `ClientUserRepository` as obsolete to encourage transition to the new `Repository` class.
2025-06-26 13:56:42 +02:00
3de7e64f85 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.
2025-06-26 13:53:54 +02:00
39a9181257 Deprecate methods and classes in UserManager.Application
Introduce `[Obsolete]` attributes to various methods and classes, suggesting alternatives such as MediatR and IRepository. Mark multiple DTOs and repository classes as obsolete, recommending the use of DigitalData.Core.Exceptions and .Middleware or Repository. This change aims to enhance maintainability and clarity in the codebase.
2025-06-26 13:37:59 +02:00
5d3f73bb13 Refactor entity properties for nullability and requirements
Removed nullable indicators from string properties in
BaseEntity.cs, ClientUser.cs, Group.cs, and User.cs.
The Username property in User.cs is now marked as
required for .NET 7 or greater, improving data integrity
and reducing null reference risks.
2025-06-26 13:20:54 +02:00
bc44de63ee Update project for multi-targeting and nullable types
Updated `DigitalData.UserManager.Domain.csproj` to support .NET 4.6.2, 7.0, 8.0, and 9.0. Adjusted implicit usings and nullable reference types settings based on the target framework, disabling nullable types for `net462` and enabling them for others.

Refactored entity classes (`BaseEntity`, `ClientUser`, `Group`, `GroupOfUser`, `Module`, `ModuleOfUser`, `User`, and `UserRep`) to conditionally include nullable reference types. Added `?` operator for string properties in .NET 7.0 and above, enhancing code safety and reducing null reference exceptions.
2025-06-26 13:15:36 +02:00
b1075c8b82 Add .NET Framework 4.6.2 support and improve nullability
Updated `DigitalData.UserManager.Domain.csproj` to target .NET Framework 4.6.2 alongside .NET 7.0, 8.0, and 9.0. Corrected `PackageTags` from "user maanger" to "user manager" and added property groups for implicit usings and language versions.

Introduced nullable reference types in entity classes (`BaseEntity`, `ClientUser`, `Group`, `User`, etc.) for enhanced type safety. Updated properties in the `User` and `UserRep` classes to use the new nullable syntax, ensuring consistency across the codebase.

These changes improve compatibility with newer C# features and maintain support for multiple frameworks.
2025-06-26 12:27:24 +02:00
40deb9968f Update namespaces and package references
Refactor namespaces from `DigitalData.Core.DTO` to `DigitalData.Core.Abstraction.Application.DTO` in multiple controllers to adopt a new abstraction layer. Update `DigitalData.Core.API` package from version `2.2.0` to `2.2.1` and add `DigitalData.Core.Abstraction.Application` package with version `1.0.0`. Add `[Obsolete("Use MediatR")]` attribute to several controllers to encourage transitioning to MediatR for request handling.
2025-06-26 11:47:43 +02:00
182771afd2 Refactor AuthController to use MediatR
- Added using directive for DigitalData.Core.Abstraction.Application.DTO.
- Marked IUserService and GetUserWithClaims as obsolete.
- Transitioning towards MediatR for handling requests and responses.
2025-06-26 10:15:58 +02:00
668eef2a4d Update BaseReadDto namespace and mark as obsolete
Replaced the namespace import from `DigitalData.Core.DTO` to `DigitalData.Core.Abstraction.Application.DTO` in `BaseReadDto.cs`. Added an `Obsolete` attribute to indicate deprecation and recommend using `DigitalData.Core.Exceptions and .Middleware` instead. This change enhances code organization and clarity.
2025-06-26 10:00:01 +02:00
e9527ca61e Refactor namespaces and update DTO structures
Updated namespaces for DTOs and services to improve project organization. Marked several interfaces as obsolete in favor of MediatR for better request handling. Simplified `BaseUpdateDto` and other DTOs by removing `IUnique<int>` implementation. Changed return types of `CreateAsync` methods to return corresponding read DTOs. Removed reference to `DigitalData.Core.DTO` in the project file, reflecting a shift in architecture for maintainability.
2025-06-25 17:14:24 +02:00
8f2ec82d4f Mark IBaseService as obsolete for MediatR usage
Added an `Obsolete` attribute to the `IBaseService` interface, recommending the use of MediatR instead. This change serves as a warning to developers about potential deprecation, encouraging a transition to the suggested alternative.
2025-06-25 16:04:27 +02:00
cc708cae0c Refactor namespace and update project dependencies
Updated the import statement for `DigitalData.Core.Abstractions.Application` to `DigitalData.Core.Abstraction.Application` in `IBaseService.cs`. Removed the `PackageReference` for `DigitalData.Core.Abstractions` version `4.0.0` from the project file, indicating a shift in library usage.
2025-06-25 16:03:14 +02:00
b936677c16 Update packages and simplify entity definitions
- Updated package references to newer versions for `DigitalData.Auth.Client`, `DigitalData.Core.API`, `DigitalData.Core.Abstractions`, `DigitalData.Core.Application`, and `DigitalData.EmailProfilerDispatcher.Abstraction`.
- Changed `UserManager.Domain` package version from `3.0.2` to `3.1.0` and updated assembly and file versions.
- Removed `IUnique<int>` interface implementation from `BaseEntity`, `ClientUser`, `Module`, and `ModuleOfUser`.
- Added data annotations to the `User` class for various properties that were previously commented out.
- Updated `Microsoft.EntityFrameworkCore` package references in the `Infrastructure` project for `net7.0` and `net9.0`.
- Modified solution configuration to change a project's build configuration from Debug to Release.
2025-06-25 14:46:39 +02:00
101 changed files with 465 additions and 267 deletions

View File

@@ -3,7 +3,8 @@
"version": "4.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve --ssl -o",
"start:ssl": "ng serve --ssl -o",
"start": "ng serve -o",
"build": "ng build --configuration production",
"watch": "ng build --watch --configuration development",
"test": "ng test",

View File

@@ -1,6 +1,6 @@
{
"/api": {
"target": "https://localhost:7103",
"target": "https://localhost:7052",
"secure": false,
"changeOrigin": true
}

View File

@@ -1,5 +1,5 @@
import { Component, inject, signal } from '@angular/core';
import { Group } from '../../../models/user-management.api.models';
import { Group } from '../../../services/api/api-models';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
import { FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MatFormFieldModule } from '@angular/material/form-field';

View File

@@ -1,5 +1,5 @@
import { Component, inject, ChangeDetectionStrategy, signal, OnInit, computed } from '@angular/core';
import { UserRep } from '../../../models/user-management.api.models';
import { UserRep } from '../../../services/api/api-models';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
import { UserRepService } from '../../../services/api/user-representation.service';
import { GroupUpdateFormComponent } from '../group-update-form/group-update-form.component';

View File

@@ -1,5 +1,5 @@
import { Component, inject, signal } from '@angular/core';
import { User } from '../../../models/user-management.api.models';
import { User } from '../../../services/api/api-models';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
import { FormControl, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';

View File

@@ -5,7 +5,7 @@ import { GroupService } from '../../services/api/group.service';
import { Observable, forkJoin, of } from 'rxjs';
import { catchError, finalize } from 'rxjs/operators';
import { DirGroupTableComponent } from '../tables/dir-group-table/dir-group-table.component';
import { DirGroup } from '../../models/user-management.api.models';
import { DirGroup } from '../../services/api/api-models';
@Component({
standalone: true,

View File

@@ -36,7 +36,7 @@ export class NavMenuComponent {
isChecked = true;
constructor(private dialog: MatDialog, private authService: AuthenticationService, public refreshService: RefreshService, public creationService: CreationService, public updateService: UpdateService, public transferService: TransferService, public buttonVisibilityService: ButtonVisibilityService, public deletionService: DeletionService) {
this.authService.isAuthenticated().then().catch()
this.authService.isAuthenticated()
this.updateActCount = this.updateService.totalCount;
this.updateService.addChangeListener(UpdateEvent.CountChange, () => {
this.updateActCount = updateService.totalCount;

View File

@@ -1,6 +1,6 @@
import { Component, Inject } from '@angular/core';
import { MatListModule } from '@angular/material/list';
import { User } from '../../../models/user-management.api.models'
import { User } from '../../../services/api/api-models'
import { MAT_BOTTOM_SHEET_DATA } from '@angular/material/bottom-sheet';
@Component({

View File

@@ -1,6 +1,6 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { BaseTableComponent } from './base-table.component';
import { ApiService } from '../../../services/api/user-management.api.service';
import { ApiService } from '../../../services/api/api-service';
import { NO_ERRORS_SCHEMA } from '@angular/core';
describe('BaseTableComponent', () => {

View File

@@ -1,5 +1,5 @@
import { Component, Inject, Input, OnDestroy, OnInit, ViewChild, input } from '@angular/core';
import { ApiService } from '../../../services/api/user-management.api.service';
import { ApiService } from '../../../services/api/api-service';
import { GuiGridModule, GuiColumn, GuiColumnMenu, GuiSorting, GuiRowDetail, GuiPaging, GuiPagingDisplay, GuiSearching, GuiCellEdit, GuiInfoPanel, GuiTitlePanel, GuiRowSelection, GuiSelectedRow, GuiGridComponent, GuiGridApi, GuiTheme, GuiRowStyle, GuiRowClass } from '@generic-ui/ngx-grid';
import { Subscription } from 'rxjs/internal/Subscription';
import { ColorModeService, Theme } from '../../../services/button/color-mode.service';

View File

@@ -1,7 +1,7 @@
import { Component, Inject } from '@angular/core';
import { BaseTableComponent } from '../base-table/base-table.component';
import { DirGroupService } from '../../../services/api/dir-group.service';
import { DirGroup } from '../../../models/user-management.api.models';
import { DirGroup } from '../../../services/api/api-models';
import { GuiGridModule } from '@generic-ui/ngx-grid';
import { ColorModeService } from '../../../services/button/color-mode.service';
import { CommonModule } from '@angular/common';

View File

@@ -1,5 +1,5 @@
import { Component, Inject } from '@angular/core';
import { DirUser } from '../../../models/user-management.api.models';
import { DirUser } from '../../../services/api/api-models';
import { DirUserService } from '../../../services/api/dir-user.service';
import { BaseTableComponent } from '../base-table/base-table.component';
import { GuiGridModule, GuiColumn } from '@generic-ui/ngx-grid';

View File

@@ -1,6 +1,6 @@
import { Component, Inject } from '@angular/core';
import { GroupService } from '../../../services/api/group.service';
import { Group } from '../../../models/user-management.api.models';
import { Group } from '../../../services/api/api-models';
import { GuiGridModule, GuiColumn } from '@generic-ui/ngx-grid';
import { BaseTableComponent } from '../base-table/base-table.component';
import { ColorModeService } from '../../../services/button/color-mode.service';

View File

@@ -1,6 +1,6 @@
import { Component, Inject } from '@angular/core';
import { GroupOfUserService } from '../../../services/group-of-user.service';
import { GroupOfUser } from '../../../models/user-management.api.models';
import { GroupOfUser } from '../../../services/api/api-models';
import { GuiGridModule, GuiColumn } from '@generic-ui/ngx-grid';
import { BaseTableComponent } from '../base-table/base-table.component';
import { ColorModeService } from '../../../services/color-mode.service';

View File

@@ -1,5 +1,5 @@
import { Component } from '@angular/core';
import { Module } from '../../../models/user-management.api.models';
import { Module } from '../../../services/api/api-models';
import { GuiGridModule } from '@generic-ui/ngx-grid';
import { BaseTableComponent } from '../base-table/base-table.component';
import { ModuleService } from '../../../services/api/module.service'

View File

@@ -1,5 +1,5 @@
import { Component } from '@angular/core';
import { UserRep } from '../../../models/user-management.api.models';
import { UserRep } from '../../../services/api/api-models';
import { UserRepService } from '../../../services/api/user-representation.service';
import { BaseTableComponent } from '../base-table/base-table.component';
import { GuiGridModule } from '@generic-ui/ngx-grid';

View File

@@ -2,7 +2,7 @@ import { Component } from '@angular/core';
import { UserService } from '../../../services/api/user.service';
import { ModuleOfUserService } from '../../../services/api/module-of-user.service';
import { GroupOfUserService } from '../../../services/api/group-of-user.service';
import { User } from '../../../models/user-management.api.models';
import { User } from '../../../services/api/api-models';
import { GuiGridModule } from '@generic-ui/ngx-grid';
import { BaseTableComponent } from '../base-table/base-table.component';
import { ColorModeService } from '../../../services/button/color-mode.service'

View File

@@ -7,7 +7,7 @@ import { catchError, finalize } from 'rxjs/operators';
import { DirGroupTableComponent } from '../tables/dir-group-table/dir-group-table.component';
import { DirUserTableComponent } from '../tables/dir-user-table/dir-user-table.component';
import { UserService } from '../../services/api/user.service';
import { User } from '../../models/user-management.api.models'
import { User } from '../../services/api/api-models'
import { RefreshService } from '../../services/button/refresh.service';
@Component({

View File

@@ -5,7 +5,7 @@ import { MatTabsModule } from '@angular/material/tabs';
import { GuiCellEdit, GuiSelectedRow } from '@generic-ui/ngx-grid';
import { GroupFormComponent } from '../../components/forms/group-form/group-form.component';
import { BasePageComponent } from '../base-page/base-page.component';
import { Group } from '../../models/user-management.api.models';
import { Group } from '../../services/api/api-models';
import { firstValueFrom, forkJoin } from 'rxjs';
import Swal from 'sweetalert2';
import { env } from '../../../environments/environment';

View File

@@ -4,7 +4,7 @@ import { GuiRowSelection, GuiRowSelectionMode, GuiRowSelectionType, GuiSelectedR
import { UserTableComponent } from '../../components/tables/user-table/user-table.component';
import { ModuleTableComponent } from '../../components/tables/module-table/module-table.component';
import { GroupTableComponent } from '../../components/tables/group-table/group-table.component';
import { User } from '../../models/user-management.api.models';
import { User } from '../../services/api/api-models';
import { MatTabsModule, MatTabGroup } from '@angular/material/tabs';
import { BasePageComponent } from '../base-page/base-page.component';

View File

@@ -8,7 +8,7 @@ import Swal from 'sweetalert2';
import { MatTabsModule, MatTabGroup } from '@angular/material/tabs';
import { env } from '../../../environments/environment';
import { BasePageComponent } from '../base-page/base-page.component';
import { Group, User, UserRep } from '../../models/user-management.api.models';
import { Group, User, UserRep } from '../../services/api/api-models';
import { RepCreateFormComponent } from '../../components/forms/rep-create-form/rep-create-form.component';
import { MatDialog } from '@angular/material/dialog';
import { BaseTableComponent } from '../../components/tables/base-table/base-table.component';

View File

@@ -6,7 +6,7 @@ import { GroupTableComponent } from '../../components/tables/group-table/group-t
import { ModuleTableComponent } from '../../components/tables/module-table/module-table.component';
import { UserCreateFormComponent } from '../../components/forms/user-create-form/user-create-form.component';
import { BasePageComponent } from '../base-page/base-page.component';
import { User } from '../../models/user-management.api.models';
import { User } from '../../services/api/api-models';
import { firstValueFrom, forkJoin } from 'rxjs';
import Swal from 'sweetalert2';
import { env } from '../../../environments/environment'

View File

@@ -8,6 +8,8 @@ export interface User {
language?: string;
comment?: string;
deleted?: boolean;
deletedWhen?: Date;
deletedWho?: string;
dateFormat?: string;
addedWho?: string;
addedWhen?: Date;
@@ -70,7 +72,7 @@ export interface UserRep {
repUser?: User
user?: User,
repGroup?: Group,
group?: Group,
group?: Group,
}
export interface DirGroup {

View File

@@ -17,21 +17,22 @@ export class AuthenticationService {
constructor(
private router: Router,
private http: HttpClient,
urlService : UrlService)
{
this.loginUrl = urlService.apiRoute.login;
this.logoutUrl = urlService.apiRoute.logout;
this.checkUrl = urlService.apiRoute.loginCheck;
}
urlService: UrlService) {
this.loginUrl = urlService.apiRoute.login;
this.logoutUrl = urlService.apiRoute.logout;
this.checkUrl = urlService.apiRoute.loginCheck;
}
async isAuthenticated(): Promise<boolean> {
try {
const response = await firstValueFrom(this.http.get<boolean>(this.checkUrl, { withCredentials: true }));
_isLogedIn = response;
return response;
} catch (error) {
this.showErrorAlert();
return false;
const response = await firstValueFrom(this.http.get(this.checkUrl, { withCredentials: true, observe: 'response' }));
_isLogedIn = response?.status === 200;
return _isLogedIn;
} catch (error: any) {
if (error?.status !== 401)
this.showErrorAlert();
_isLogedIn = false
return _isLogedIn;
}
}
@@ -81,4 +82,4 @@ export class AuthenticationService {
}
let _isLogedIn: boolean = false;
export const IsLogedIn = () => _isLogedIn
export const IsLogedIn = () => _isLogedIn

View File

@@ -1,7 +1,7 @@
import { Injectable, Inject } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { DirGroup, } from '../../models/user-management.api.models';
import { ApiService } from './user-management.api.service';
import { DirGroup, } from './api-models';
import { ApiService } from './api-service';
import { Observable } from 'rxjs/internal/Observable';
import Swal from 'sweetalert2';
import { UrlService } from './url.service';

View File

@@ -1,7 +1,7 @@
import { Injectable, Inject } from '@angular/core';
import { HttpClient, HttpParams } from '@angular/common/http';
import { DirUser } from '../../models/user-management.api.models';
import { ApiService } from './user-management.api.service';
import { DirUser } from './api-models';
import { ApiService } from './api-service';
import { Observable } from 'rxjs/internal/Observable';
import { UrlService } from './url.service';

View File

@@ -1,7 +1,7 @@
import { HttpClient, HttpParams } from '@angular/common/http';
import { Observable } from 'rxjs';
import { Inject, Injectable } from '@angular/core';
import { DirUser } from '../../models/user-management.api.models';
import { DirUser } from './api-models';
import { UrlService } from './url.service';
@Injectable({

View File

@@ -1,7 +1,7 @@
import { Injectable } from '@angular/core';
import { HttpClient, HttpParams } from '@angular/common/http';
import { GroupOfUser } from '../../models/user-management.api.models';
import { ApiService } from './user-management.api.service';
import { GroupOfUser } from './api-models';
import { ApiService } from './api-service';
import { Observable, firstValueFrom } from 'rxjs';
import { UrlService } from './url.service';

View File

@@ -1,7 +1,7 @@
import { Injectable, Inject } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { DirGroup, Group, } from '../../models/user-management.api.models';
import { ApiService } from './user-management.api.service';
import { DirGroup, Group, } from './api-models';
import { ApiService } from './api-service';
import { Observable } from 'rxjs/internal/Observable';
import { UrlService } from './url.service';

View File

@@ -1,7 +1,7 @@
import { Injectable, Inject } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { ModuleOfUser } from '../../models/user-management.api.models';
import { ApiService } from './user-management.api.service';
import { ModuleOfUser } from './api-models';
import { ApiService } from './api-service';
import { Observable, firstValueFrom } from 'rxjs';
import { UrlService } from './url.service';

View File

@@ -1,7 +1,7 @@
import { Injectable, Inject } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { ApiService } from './user-management.api.service';
import { Module } from '../../models/user-management.api.models';
import { ApiService } from './api-service';
import { Module } from './api-models';
import { UrlService } from './url.service';
@Injectable({

View File

@@ -1,6 +1,6 @@
import { Inject, Injectable } from "@angular/core";
import { UserRep } from "../../models/user-management.api.models";
import { ApiService } from "./user-management.api.service";
import { UserRep } from "./api-models";
import { ApiService } from "./api-service";
import { HttpClient, HttpParams } from "@angular/common/http";
import { Observable } from "rxjs";
import { UrlService } from "./url.service";

View File

@@ -1,7 +1,7 @@
import { Injectable, Inject } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { DirUser, User } from '../../models/user-management.api.models';
import { ApiService } from './user-management.api.service';
import { DirUser, User } from './api-models';
import { ApiService } from './api-service';
import { Observable } from 'rxjs';
import { UrlService } from './url.service';

View File

@@ -2,10 +2,10 @@
using Microsoft.AspNetCore.Authorization;
using DigitalData.UserManager.Application.DTOs.Auth;
using DigitalData.UserManager.Application.Contracts;
using DigitalData.Core.DTO;
using Microsoft.Extensions.Localization;
using DigitalData.UserManager.Application;
using System.Security.Claims;
using DigitalData.Core.Abstraction.Application.DTO;
namespace DigitalData.UserManager.API.Controllers;
@@ -13,10 +13,13 @@ 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;
private readonly IStringLocalizer<Resource> _localizer;
[Obsolete("Use MediatR")]
public AuthController(ILogger<UserController> logger, IUserService userService, IStringLocalizer<Resource> localizer)
{
_logger = logger;
@@ -34,6 +37,7 @@ public class AuthController : ControllerBase
[Authorize]
[HttpGet("user")]
[Obsolete("Use MediatR")]
public async Task<IActionResult> GetUserWithClaims()
{
try

View File

@@ -1,5 +1,5 @@
using DigitalData.Core.API;
using DigitalData.Core.DTO;
using DigitalData.Core.Abstraction.Application.DTO;
using DigitalData.Core.API;
using DigitalData.UserManager.Application.Contracts;
using DigitalData.UserManager.Application.DTOs.Base;
using DigitalData.UserManager.Application.DTOs.User;
@@ -10,6 +10,7 @@ using System.Security.Claims;
namespace DigitalData.UserManager.API.Controllers;
[Authorize]
[Obsolete("Use MediatR")]
public class BaseAuthController<TCRUDService, TCreateDto, TReadDto, TUpdateDto, TBaseEntity> : CRUDControllerBaseWithErrorHandling<TCRUDService, TCreateDto, TReadDto, TUpdateDto, TBaseEntity, int>
where TCRUDService : IBaseService<TCreateDto, TReadDto, TBaseEntity>
where TCreateDto : BaseCreateDto

View File

@@ -1,5 +1,4 @@
using DigitalData.Core.Abstractions.Application;
using DigitalData.UserManager.Application.Contracts;
using DigitalData.UserManager.Application.Contracts;
using DigitalData.UserManager.Application.DTOs;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Caching.Memory;
@@ -7,14 +6,16 @@ using System.Diagnostics.CodeAnalysis;
using System.Security.Claims;
using DigitalData.UserManager.Application;
using Microsoft.Extensions.Localization;
using DigitalData.Core.DTO;
using Microsoft.AspNetCore.Authorization;
using DigitalData.Core.Abstraction.Application;
using DigitalData.Core.Abstraction.Application.DTO;
namespace DigitalData.UserManager.API.Controllers;
[Route("api/[controller]")]
[SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "<Pending>")]
[Authorize]
[Obsolete("Use MediatR")]
public class DirectoryController : ControllerBase
{
private readonly IUserService _userService;

View File

@@ -1,4 +1,4 @@
using DigitalData.Core.DTO;
using DigitalData.Core.Abstraction.Application.DTO;
using DigitalData.UserManager.Application.Contracts;
using DigitalData.UserManager.Application.DTOs.Group;
using DigitalData.UserManager.Domain.Entities;
@@ -8,6 +8,7 @@ using Microsoft.AspNetCore.Mvc;
namespace DigitalData.UserManager.API.Controllers;
[Authorize]
[Obsolete("Use MediatR")]
public class GroupController : BaseAuthController<IGroupService, GroupCreateDto, GroupReadDto, GroupUpdateDto, Group>
{
public GroupController(ILogger<GroupController> logger, IGroupService service, IUserService userService) : base(logger, service, userService)

View File

@@ -1,4 +1,4 @@
using DigitalData.Core.DTO;
using DigitalData.Core.Abstraction.Application.DTO;
using DigitalData.UserManager.Application.Contracts;
using DigitalData.UserManager.Application.DTOs.GroupOfUser;
using DigitalData.UserManager.Domain.Entities;
@@ -8,6 +8,7 @@ using Microsoft.AspNetCore.Mvc;
namespace DigitalData.UserManager.API.Controllers;
[Authorize]
[Obsolete("Use MediatR")]
public class GroupOfUserController : BaseAuthController<IGroupOfUserService, GroupOfUserCreateDto, GroupOfUserReadDto, GroupOfUserUpdateDto, GroupOfUser>
{
public GroupOfUserController(ILogger<GroupOfUserController> logger, IGroupOfUserService service, IUserService userService) : base(logger, service, userService)

View File

@@ -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)
{
}

View File

@@ -1,5 +1,5 @@
using DigitalData.Core.Abstraction.Application.DTO;
using DigitalData.Core.API;
using DigitalData.Core.DTO;
using DigitalData.UserManager.Application.Contracts;
using DigitalData.UserManager.Application.DTOs.ModuleOfUser;
using DigitalData.UserManager.Domain.Entities;
@@ -9,6 +9,7 @@ using Microsoft.AspNetCore.Mvc;
namespace DigitalData.UserManager.API.Controllers;
[Authorize]
[Obsolete("Use MediatR")]
public class ModuleOfUserController : CRUDControllerBaseWithErrorHandling<IModuleOfUserService, ModuleOfUserCreateDto, ModuleOfUserReadDto, ModuleOfUserUpdateDto, ModuleOfUser, int>
{
public ModuleOfUserController(ILogger<ModuleOfUserController> logger, IModuleOfUserService service) : base(logger, service)

View File

@@ -1,4 +1,4 @@
using DigitalData.Core.DTO;
using DigitalData.Core.Abstraction.Application.DTO;
using DigitalData.UserManager.Application.Contracts;
using DigitalData.UserManager.Application.DTOs.User;
using DigitalData.UserManager.Domain.Entities;
@@ -8,6 +8,9 @@ using Microsoft.AspNetCore.Mvc;
namespace DigitalData.UserManager.API.Controllers;
[Authorize]
[Obsolete("Use MediatR")]
[Route("api/[controller]")]
[ApiController]
public class UserController : BaseAuthController<IUserService, UserCreateDto, UserReadDto, UserUpdateDto, User>
{
public UserController(ILogger<UserController> logger, IUserService service) : base(logger, service, service)

View File

@@ -1,4 +1,4 @@
using DigitalData.Core.DTO;
using DigitalData.Core.Abstraction.Application.DTO;
using DigitalData.UserManager.Application.Contracts;
using DigitalData.UserManager.Application.DTOs.UserRep;
using DigitalData.UserManager.Domain.Entities;
@@ -8,6 +8,7 @@ using Microsoft.AspNetCore.Mvc;
namespace DigitalData.UserManager.API.Controllers;
[Authorize]
[Obsolete("Use MediatR")]
public class UserRepController : BaseAuthController<IUserRepService, UserRepCreateDto, UserRepReadDto, UserRepUpdateDto, UserRep>
{
public UserRepController(ILogger<UserRepController> logger, IUserRepService service, IUserService userService) : base(logger, service, userService)

View File

@@ -4,9 +4,9 @@
<TargetFrameworks>net7.0;net8.0;net9.0</TargetFrameworks>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Version>6.0.1</Version>
<AssemblyVersion>6.0.1</AssemblyVersion>
<FileVersion>6.0.1</FileVersion>
<Version>6.1.2</Version>
<AssemblyVersion>6.1.2</AssemblyVersion>
<FileVersion>6.1.2</FileVersion>
<PackageIcon>icon.png</PackageIcon>
</PropertyGroup>
@@ -21,8 +21,9 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="DigitalData.Auth.Client" Version="1.3.5" />
<PackageReference Include="DigitalData.Core.API" Version="2.1.1" />
<PackageReference Include="DigitalData.Auth.Client" Version="1.3.7" />
<PackageReference Include="DigitalData.Core.Abstraction.Application" Version="1.0.0" />
<PackageReference Include="DigitalData.Core.API" Version="2.2.1" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.14" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="7.0.20" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="7.0.4" />

View File

@@ -1,8 +1,6 @@
using Microsoft.EntityFrameworkCore;
using DigitalData.UserManager.Infrastructure.Repositories;
using DigitalData.UserManager.Application;
using DigitalData.Core.Application;
using Microsoft.AspNetCore.Authentication.Cookies;
using NLog.Web;
using NLog;
using DigitalData.Core.API;
@@ -31,8 +29,11 @@ try {
builder.Services.AddEncryptor(builder.Configuration.GetSection("EncryptionParameters"));
builder.Logging.ClearProviders();
builder.Host.UseNLog();
if (!builder.Environment.IsDevelopment())
{
builder.Logging.ClearProviders();
builder.Host.UseNLog();
}
builder.Services.AddControllers(opt =>
{
@@ -50,27 +51,12 @@ try {
builder.Services.AddSwaggerGen();
}
builder.Services.AddControllers(opt =>
{
opt.Conventions.Add(new RemoveIfControllerConvention()
.AndIf(c => c.ControllerName == nameof(EncryptionController).Replace("Controller", ""))
.AndIf(c => !config.GetValue<bool>("UseEncryptor")));
});
builder.Services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
.AddCookie(options =>
{
options.Cookie.HttpOnly = true; // Makes the cookie inaccessible to client-side scripts for security
options.Cookie.SecurePolicy = CookieSecurePolicy.SameAsRequest; // Ensures cookies are sent over HTTPS only
options.Cookie.SameSite = SameSiteMode.Strict; // Protects against CSRF attacks by restricting how cookies are sent with requests from external sites
options.LoginPath = "/api/auth/login";
options.LogoutPath = "/api/auth/logout";
});
// 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.");
@@ -99,45 +85,44 @@ try {
var authTokenKeys = config.GetSection(nameof(AuthTokenKeys)).Get<AuthTokenKeys>() ?? new();
builder.Services
.AddAuthentication(options =>
{
options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;
options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;
})
.AddJwtBearer(opt =>
{
opt.TokenValidationParameters = new TokenValidationParameters
builder.Services.AddAuthentication(options =>
{
options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;
options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;
})
.AddJwtBearer(opt =>
{
ValidateIssuerSigningKey = true,
IssuerSigningKeyResolver = (token, securityToken, identifier, parameters) =>
opt.TokenValidationParameters = new TokenValidationParameters
{
var clientParams = lazyProvider.GetRequiredService<IOptions<ClientParams>>()?.Value;
var publicKey = clientParams!.PublicKeys.Get(authTokenKeys.Issuer, authTokenKeys.Audience);
return new List<SecurityKey>() { publicKey.SecurityKey };
},
ValidateIssuer = true,
ValidIssuer = authTokenKeys.Issuer,
ValidateAudience = true,
ValidAudience = authTokenKeys.Audience,
};
opt.Events = new JwtBearerEvents
{
OnMessageReceived = context =>
{
// if there is no token read related cookie or query string
if (context.Token is null) // if there is no token
ValidateIssuerSigningKey = true,
IssuerSigningKeyResolver = (token, securityToken, identifier, parameters) =>
{
if (context.Request.Cookies.TryGetValue(authTokenKeys.Cookie, out var cookieToken) && cookieToken is not null)
context.Token = cookieToken;
else if (context.Request.Query.TryGetValue(authTokenKeys.QueryString, out var queryStrToken))
context.Token = queryStrToken;
var clientParams = lazyProvider.GetRequiredService<IOptions<ClientParams>>()?.Value;
var publicKey = clientParams!.PublicKeys.Get(authTokenKeys.Issuer, authTokenKeys.Audience);
return new List<SecurityKey>() { publicKey.SecurityKey };
},
ValidateIssuer = true,
ValidIssuer = authTokenKeys.Issuer,
ValidateAudience = true,
ValidAudience = authTokenKeys.Audience,
};
opt.Events = new JwtBearerEvents
{
OnMessageReceived = context =>
{
// if there is no token read related cookie or query string
if (context.Token is null) // if there is no token
{
if (context.Request.Cookies.TryGetValue(authTokenKeys.Cookie, out var cookieToken) && cookieToken is not null)
context.Token = cookieToken;
else if (context.Request.Query.TryGetValue(authTokenKeys.QueryString, out var queryStrToken))
context.Token = queryStrToken;
}
return Task.CompletedTask;
}
return Task.CompletedTask;
}
};
});
};
});
builder.Services.AddSwaggerGen(setupAct =>
{

View File

@@ -11,7 +11,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
<ExcludeApp_Data>false</ExcludeApp_Data>
<ProjectGuid>07ccd651-647c-49f7-9715-30cebc13710d</ProjectGuid>
<DesktopBuildPackageLocation>P:\Install .Net\0 DD - Smart UP\DD-UserManager\Web\$(Version)\$(Version).zip</DesktopBuildPackageLocation>
<DesktopBuildPackageLocation>P:\Install .Net\0 DD - Smart UP\DD-UserManager\API\$(Version)\$(Version).zip</DesktopBuildPackageLocation>
<PackageAsSingleFile>true</PackageAsSingleFile>
<DeployIisAppPath>UserManager.API</DeployIisAppPath>
<_TargetId>IISWebDeployPackage</_TargetId>

View File

@@ -77,7 +77,7 @@
"UseEncryptor": true,
"UseSwagger": true,
"AuthClientParams": {
"Url": "https://localhost:7192/auth-hub",
"Url": "https://localhost:9090/auth-hub",
"PublicKeys": [
{
"Issuer": "auth.digitaldata.works",

View File

@@ -1,10 +1,11 @@
using DigitalData.UserManager.Domain.Entities;
using DigitalData.Core.Abstractions.Application;
using DigitalData.UserManager.Application.DTOs.User;
using DigitalData.UserManager.Application.DTOs.Base;
using DigitalData.Core.Abstraction.Application;
namespace DigitalData.UserManager.Application.Contracts
{
[Obsolete("Use MediatR")]
public interface IBaseService<TCreateDto, TReadDto, TBaseEntity> : ICRUDService<TCreateDto, TReadDto, TBaseEntity, int>
where TCreateDto : BaseCreateDto
where TReadDto : class
@@ -14,5 +15,5 @@ namespace DigitalData.UserManager.Application.Contracts
public Func<Task<UserReadDto?>> UserFactoryAsync { set; }
public Task<UserReadDto?> GetUserAsync();
}
}
}

View File

@@ -1,9 +1,10 @@
using DigitalData.UserManager.Application.DTOs.GroupOfUser;
using DigitalData.UserManager.Domain.Entities;
using DigitalData.Core.DTO;
using DigitalData.Core.Abstraction.Application.DTO;
namespace DigitalData.UserManager.Application.Contracts
{
[Obsolete("Use MediatR")]
public interface IGroupOfUserService : IBaseService<GroupOfUserCreateDto, GroupOfUserReadDto, GroupOfUser>
{
Task<Result> DeleteAsyncByGroupUserId(int groupId, int userId);

View File

@@ -1,9 +1,10 @@
using DigitalData.UserManager.Application.DTOs.Group;
using DigitalData.UserManager.Domain.Entities;
using DigitalData.Core.DTO;
using DigitalData.Core.Abstraction.Application.DTO;
namespace DigitalData.UserManager.Application.Contracts
{
[Obsolete("Use MediatR")]
public interface IGroupService : IBaseService<GroupCreateDto, GroupReadDto, Group>
{
Task<DataResult<int>> CreateAsync(DirectoryGroupDto dirGroup);

View File

@@ -1,10 +1,11 @@
using DigitalData.Core.Abstractions.Application;
using DigitalData.Core.DTO;
using DigitalData.Core.Abstraction.Application;
using DigitalData.Core.Abstraction.Application.DTO;
using DigitalData.UserManager.Application.DTOs.ModuleOfUser;
using DigitalData.UserManager.Domain.Entities;
namespace DigitalData.UserManager.Application.Contracts
{
[Obsolete("Use MediatR")]
public interface IModuleOfUserService : ICRUDService<ModuleOfUserCreateDto, ModuleOfUserReadDto, ModuleOfUser, int>
{
Task<Result> DeleteAsyncByModuleUserId(int moduleId, int userId);

View File

@@ -1,9 +1,10 @@
using DigitalData.Core.Abstractions.Application;
using DigitalData.Core.Abstraction.Application;
using DigitalData.UserManager.Application.DTOs.Module;
using DigitalData.UserManager.Domain.Entities;
namespace DigitalData.UserManager.Application.Contracts
{
[Obsolete("Use MediatR")]
public interface IModuleService : IBasicCRUDService<ModuleDto, Module, int>
{
}

View File

@@ -1,9 +1,10 @@
using DigitalData.UserManager.Application.DTOs.UserRep;
using DigitalData.UserManager.Domain.Entities;
using DigitalData.Core.DTO;
using DigitalData.Core.Abstraction.Application.DTO;
namespace DigitalData.UserManager.Application.Contracts
{
[Obsolete("Use MediatR")]
public interface IUserRepService : IBaseService<UserRepCreateDto, UserRepReadDto, UserRep>
{
Task<DataResult<IEnumerable<UserRepReadDto>>> ReadAllAsync(bool withUser = false, bool withRepGroup = false, bool withGroup = false, bool withRepUser = false, int? userId = null, int? groupId = null);

View File

@@ -1,9 +1,10 @@
using DigitalData.UserManager.Application.DTOs.User;
using DigitalData.UserManager.Domain.Entities;
using DigitalData.Core.DTO;
using DigitalData.Core.Abstraction.Application.DTO;
namespace DigitalData.UserManager.Application.Contracts
{
[Obsolete("Use MediatR")]
public interface IUserService : IBaseService<UserCreateDto, UserReadDto, User>
{
Task<DataResult<IEnumerable<UserReadDto>>> ReadByModuleIdAsync(int moduleId);

View File

@@ -1,8 +1,9 @@
using DigitalData.Core.Abstractions.Infrastructure;
using DigitalData.Core.Abstraction.Application.Repository;
using DigitalData.UserManager.Domain.Entities;
namespace DigitalData.UserManager.Application.Contracts.Repositories;
[Obsolete("Use IRepository")]
public interface IClientUserRepository : ICRUDRepository<ClientUser, int>
{
Task<IEnumerable<ClientUser>> ReadAsync(bool readOnly = true, int? userId = null);

View File

@@ -1,8 +1,9 @@
using DigitalData.Core.Abstractions.Infrastructure;
using DigitalData.Core.Abstraction.Application.Repository;
using DigitalData.UserManager.Domain.Entities;
namespace DigitalData.UserManager.Application.Contracts.Repositories;
[Obsolete("Use IRepository")]
public interface IGroupOfUserRepository : ICRUDRepository<GroupOfUser, int>
{
IQueryable<GroupOfUser> ReadByGroupId(int groupId);

View File

@@ -1,8 +1,9 @@
using DigitalData.Core.Abstractions.Infrastructure;
using DigitalData.Core.Abstraction.Application.Repository;
using DigitalData.UserManager.Domain.Entities;
namespace DigitalData.UserManager.Application.Contracts.Repositories;
[Obsolete("Use IRepository")]
public interface IGroupRepository : ICRUDRepository<Group, int>
{
}

View File

@@ -1,8 +1,9 @@
using DigitalData.Core.Abstractions.Infrastructure;
using DigitalData.Core.Abstraction.Application.Repository;
using DigitalData.UserManager.Domain.Entities;
namespace DigitalData.UserManager.Application.Contracts.Repositories;
[Obsolete("Use IRepository")]
public interface IModuleOfUserRepository : ICRUDRepository<ModuleOfUser, int>
{
IQueryable<ModuleOfUser> ReadByModuleId(int moduleId);

View File

@@ -1,8 +1,9 @@
using DigitalData.Core.Abstractions.Infrastructure;
using DigitalData.Core.Abstraction.Application.Repository;
using DigitalData.UserManager.Domain.Entities;
namespace DigitalData.UserManager.Application.Contracts.Repositories;
[Obsolete("Use IRepository")]
public interface IModuleRepository : ICRUDRepository<Module, int>
{
}

View File

@@ -1,8 +1,9 @@
using DigitalData.Core.Abstractions.Infrastructure;
using DigitalData.Core.Abstraction.Application.Repository;
using DigitalData.UserManager.Domain.Entities;
namespace DigitalData.UserManager.Application.Contracts.Repositories;
[Obsolete("Use IRepository")]
public interface IUserRepRepository : ICRUDRepository<UserRep, int>
{
Task<IEnumerable<UserRep>> ReadAllAsync(

View File

@@ -1,8 +1,9 @@
using DigitalData.Core.Abstractions.Infrastructure;
using DigitalData.Core.Abstraction.Application.Repository;
using DigitalData.UserManager.Domain.Entities;
namespace DigitalData.UserManager.Application.Contracts.Repositories;
[Obsolete("Use IRepository")]
public interface IUserRepository : ICRUDRepository<User, int>
{
Task<IEnumerable<User>> ReadByModuleIdAsync(int moduleId);

View File

@@ -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)

View File

@@ -1,7 +1,8 @@
using DigitalData.Core.DTO;
using DigitalData.Core.Abstraction.Application.DTO;
namespace DigitalData.UserManager.Application.DTOs.Base
{
// TODO: use getter - setter methods for a simple inheritance.
[Obsolete("Use DigitalData.Core.Exceptions and .Middleware")]
public record BaseReadDto(int Id, string? AddedWho, DateTime? AddedWhen, string? ChangedWho, DateTime? ChangedWhen) : BaseDTO<int>(Id);
}

View File

@@ -1,8 +1,6 @@
using DigitalData.Core.Abstractions;
namespace DigitalData.UserManager.Application.DTOs.Base
namespace DigitalData.UserManager.Application.DTOs.Base
{
public record BaseUpdateDto() : IUnique<int>
public record BaseUpdateDto
{
public string ChangedWho { get; set; } = "UNAUTHORIZED";

View File

@@ -2,6 +2,7 @@
namespace DigitalData.UserManager.Application.DTOs.Group
{
[Obsolete("Use DigitalData.Core.Exceptions and .Middleware")]
public record GroupReadDto
(
int Id,

View File

@@ -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,

View File

@@ -1,10 +1,8 @@
using DigitalData.Core.Abstractions;
namespace DigitalData.UserManager.Application.DTOs.Module
namespace DigitalData.UserManager.Application.DTOs.Module
{
public record ModuleDto(
int Id,
string? Name,
string? ShortName
) : IUnique<int>;
);
}

View File

@@ -1,6 +1,4 @@
using DigitalData.Core.Abstractions;
namespace DigitalData.UserManager.Application.DTOs.ModuleOfUser
namespace DigitalData.UserManager.Application.DTOs.ModuleOfUser
{
public record ModuleOfUserUpdateDto(
int Id,
@@ -9,5 +7,5 @@ namespace DigitalData.UserManager.Application.DTOs.ModuleOfUser
bool? IsAdmin,
string? Comment,
string? ChangedWho
) : IUnique<int>;
);
}

View File

@@ -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,

View File

@@ -5,7 +5,6 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PackageId>UserManager.Application</PackageId>
<Version>3.1.3</Version>
<Authors>Digital Data GmbH</Authors>
<Company>Digital Data GmbH</Company>
<Product>UserManager.Application</Product>
@@ -14,8 +13,9 @@
<PackageIcon>icon.png</PackageIcon>
<RepositoryUrl>http://git.dd:3000/AppStd/WebUserManager.git</RepositoryUrl>
<PackageTags>digital data application user maanger</PackageTags>
<AssemblyVersion>3.1.3</AssemblyVersion>
<FileVersion>3.1.3</FileVersion>
<Version>3.2.1</Version>
<AssemblyVersion>3.2.1</AssemblyVersion>
<FileVersion>3.2.1</FileVersion>
</PropertyGroup>
<ItemGroup>
@@ -26,10 +26,9 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="DigitalData.Core.Abstractions" Version="3.4.1" />
<PackageReference Include="DigitalData.Core.Application" Version="3.2.1" />
<PackageReference Include="DigitalData.Core.DTO" Version="2.0.1" />
<PackageReference Include="DigitalData.EmailProfilerDispatcher.Abstraction" Version="3.0.0" />
<PackageReference Include="DigitalData.Core.Abstraction.Application" Version="1.0.0" />
<PackageReference Include="DigitalData.Core.Application" Version="3.3.4" />
<PackageReference Include="DigitalData.EmailProfilerDispatcher.Abstraction" Version="3.1.1" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">

View File

@@ -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>();

View File

@@ -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>();
}
}
}
}

View File

@@ -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>();

View File

@@ -1,7 +1,7 @@
using AutoMapper;
using DigitalData.Core.Abstractions.Infrastructure;
using DigitalData.Core.Abstraction.Application.DTO;
using DigitalData.Core.Abstraction.Application.Repository;
using DigitalData.Core.Application;
using DigitalData.Core.DTO;
using DigitalData.UserManager.Application.Contracts;
using DigitalData.UserManager.Application.DTOs.Base;
using DigitalData.UserManager.Application.DTOs.User;
@@ -9,6 +9,7 @@ using DigitalData.UserManager.Domain.Entities;
namespace DigitalData.UserManager.Application.Services
{
[Obsolete("Use MediatR")]
public class BaseService<TCRUDRepository, TCreateDto, TReadDto, TBaseEntity> : CRUDService<TCRUDRepository, TCreateDto, TReadDto, TBaseEntity, int>, IBaseService<TCreateDto, TReadDto, TBaseEntity>
where TCRUDRepository : ICRUDRepository<TBaseEntity, int>
where TCreateDto : BaseCreateDto
@@ -25,7 +26,7 @@ namespace DigitalData.UserManager.Application.Services
public async Task<UserReadDto?> GetUserAsync() => _lazyUserAsync is null ? null : await _lazyUserAsync.Value;
public override async Task<DataResult<int>> CreateAsync(TCreateDto createDto)
public override async Task<DataResult<TReadDto>> CreateAsync(TCreateDto createDto)
{
var user = await GetUserAsync();
if(user is not null)

View File

@@ -1,12 +1,13 @@
using AutoMapper;
using DigitalData.Core.DTO;
using DigitalData.UserManager.Application.Contracts;
using DigitalData.UserManager.Application.DTOs.GroupOfUser;
using DigitalData.UserManager.Domain.Entities;
using DigitalData.UserManager.Application.Contracts.Repositories;
using DigitalData.Core.Abstraction.Application.DTO;
namespace DigitalData.UserManager.Application.Services
{
[Obsolete("Use MediatR")]
public class GroupOfUserService : BaseService<IGroupOfUserRepository, GroupOfUserCreateDto, GroupOfUserReadDto, GroupOfUser>, IGroupOfUserService
{
public GroupOfUserService(IGroupOfUserRepository repository, IMapper mapper) : base(repository, mapper)

View File

@@ -1,13 +1,14 @@
using AutoMapper;
using DigitalData.Core.DTO;
using DigitalData.UserManager.Application.Contracts;
using DigitalData.UserManager.Application.DTOs.Group;
using DigitalData.UserManager.Domain.Entities;
using DigitalData.UserManager.Application.Contracts.Repositories;
using Microsoft.Extensions.Localization;
using DigitalData.Core.Abstraction.Application.DTO;
namespace DigitalData.UserManager.Application.Services
{
[Obsolete("Use MediatR")]
public class GroupService : BaseService<IGroupRepository, GroupCreateDto, GroupReadDto, Group>, IGroupService
{
private readonly IStringLocalizer<Resource>? _localizer;

View File

@@ -1,13 +1,14 @@
using AutoMapper;
using DigitalData.Core.Application;
using DigitalData.Core.DTO;
using DigitalData.UserManager.Application.Contracts;
using DigitalData.UserManager.Application.DTOs.ModuleOfUser;
using DigitalData.UserManager.Domain.Entities;
using DigitalData.UserManager.Application.Contracts.Repositories;
using DigitalData.Core.Abstraction.Application.DTO;
namespace DigitalData.UserManager.Application.Services
{
[Obsolete("Use MediatR")]
public class ModuleOfUserService : CRUDService<IModuleOfUserRepository, ModuleOfUserCreateDto, ModuleOfUserReadDto, ModuleOfUser, int>, IModuleOfUserService
{
public ModuleOfUserService(IModuleOfUserRepository repository, IMapper mapper) : base(repository, mapper)

View File

@@ -7,6 +7,7 @@ using DigitalData.UserManager.Application.Contracts.Repositories;
namespace DigitalData.UserManager.Application.Services
{
[Obsolete("Use MediatR")]
public class ModuleService : BasicCRUDService<IModuleRepository, ModuleDto, Module, int>, IModuleService
{
public ModuleService(IModuleRepository repository, IMapper mapper) : base(repository, mapper)

View File

@@ -1,14 +1,15 @@
using AutoMapper;
using DigitalData.Core.DTO;
using DigitalData.UserManager.Application.Contracts;
using DigitalData.UserManager.Application.DTOs.UserRep;
using DigitalData.UserManager.Domain.Entities;
using DigitalData.UserManager.Application.Contracts.Repositories;
using Microsoft.Extensions.Localization;
using Microsoft.Extensions.Logging;
using DigitalData.Core.Abstraction.Application.DTO;
namespace DigitalData.UserManager.Application.Services
{
[Obsolete("Use MediatR")]
public class UserRepService : BaseService<IUserRepRepository, UserRepCreateDto, UserRepReadDto, UserRep>, IUserRepService
{
private readonly IStringLocalizer<Resource>? _localizer;
@@ -24,13 +25,13 @@ namespace DigitalData.UserManager.Application.Services
return Result.Success(urReadDTOs);
}
public override async Task<DataResult<int>> CreateAsync(UserRepCreateDto createDto)
public override async Task<DataResult<UserRepReadDto>> CreateAsync(UserRepCreateDto createDto)
// XOR control
=> (createDto.ValidFrom is null && createDto.ValidTo is not null) || (createDto.ValidFrom is not null && createDto.ValidTo is null)
? Result.Fail<int>().Notice(LogLevel.None, Flag.DataIntegrityIssue, _localizer?[Key.DateRangeNotXNOR].Value)
? Result.Fail<UserRepReadDto>().Notice(LogLevel.None, Flag.DataIntegrityIssue, _localizer?[Key.DateRangeNotXNOR].Value)
//date range control
: (createDto.ValidFrom > createDto.ValidTo)
? Result.Fail<int>().Notice(LogLevel.None, Flag.DataIntegrityIssue, _localizer?[Key.InvalidDateRange].Value)
? Result.Fail<UserRepReadDto>().Notice(LogLevel.None, Flag.DataIntegrityIssue, _localizer?[Key.InvalidDateRange].Value)
: await base.CreateAsync(createDto);
}
}

View File

@@ -1,13 +1,14 @@
using AutoMapper;
using DigitalData.Core.DTO;
using DigitalData.UserManager.Application.Contracts;
using DigitalData.UserManager.Application.DTOs.User;
using DigitalData.UserManager.Domain.Entities;
using DigitalData.UserManager.Application.Contracts.Repositories;
using Microsoft.Extensions.Localization;
using DigitalData.Core.Abstraction.Application.DTO;
namespace DigitalData.UserManager.Application.Services
{
[Obsolete("Use MediatR")]
public class UserService : BaseService<IUserRepository, UserCreateDto, UserReadDto, User>, IUserService
{
private readonly IStringLocalizer<Resource>? _localizer;

View File

@@ -5,7 +5,6 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PackageId>UserManager</PackageId>
<Version>1.0.0</Version>
<Authors>Digital Data GmbH</Authors>
<Company>Digital Data GmbH</Company>
<Product>UserManager</Product>
@@ -14,8 +13,9 @@
<PackageIcon>icon.png</PackageIcon>
<RepositoryUrl>http://git.dd:3000/AppStd/WebUserManager.git</RepositoryUrl>
<PackageTags>digital data user maanger</PackageTags>
<AssemblyVersion>1.0.0</AssemblyVersion>
<FileVersion>1.0.0</FileVersion>
<Version>1.1.2</Version>
<AssemblyVersion>1.1.2</AssemblyVersion>
<FileVersion>1.1.2</FileVersion>
</PropertyGroup>
<ItemGroup>
@@ -25,6 +25,10 @@
</None>
</ItemGroup>
<ItemGroup>
<PackageReference Include="DigitalData.Core.Abstraction.Application" Version="1.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DigitalData.UserManager.Application\DigitalData.UserManager.Application.csproj" />
<ProjectReference Include="..\DigitalData.UserManager.Domain\DigitalData.UserManager.Domain.csproj" />

View File

@@ -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;
}
}
}

View File

@@ -1,11 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net7.0;net8.0;net9.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<TargetFrameworks>net462;net7.0;net8.0;net9.0</TargetFrameworks>
<PackageId>UserManager.Domain</PackageId>
<Version>3.0.2</Version>
<Authors>Digital Data GmbH</Authors>
<Company>Digital Data GmbH</Company>
<Product>UserManager.Domain</Product>
@@ -13,20 +10,46 @@
<Copyright>Copyright 2024</Copyright>
<PackageIcon>icon.png</PackageIcon>
<RepositoryUrl>http://git.dd:3000/AppStd/WebUserManager.git</RepositoryUrl>
<PackageTags>digital data domain user maanger</PackageTags>
<AssemblyVersion>3.0.2</AssemblyVersion>
<FileVersion>3.0.2</FileVersion>
<PackageTags>digital data domain user manager</PackageTags>
<Version>3.2.3</Version>
<AssemblyVersion>3.2.3</AssemblyVersion>
<FileVersion>3.2.3</FileVersion>
</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>
<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
<PackageReference Include="System.ComponentModel.Annotations" Version="4.7.0" />
<PackageReference Include="System.Drawing.Common" Version="4.7.3" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<PackageReference Include="System.Drawing.Common" Version="7.0.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="System.Drawing.Common" Version="8.0.16" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
<PackageReference Include="System.Drawing.Common" Version="9.0.5" />
</ItemGroup>
<ItemGroup>
<None Include="..\Assets\icon.png">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>
<ItemGroup>
<PackageReference Include="DigitalData.Core.Abstractions" Version="3.4.0" />
</ItemGroup>
</Project>

View File

@@ -1,11 +1,13 @@
using DigitalData.Core.Abstractions;
using System.ComponentModel;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
#if NETFRAMEWORK
using System;
#endif
namespace DigitalData.UserManager.Domain.Entities
{
public class BaseEntity : IUnique<int>
public class BaseEntity
{
[Column("GUID")]
[Key]
@@ -14,11 +16,19 @@ namespace DigitalData.UserManager.Domain.Entities
[StringLength(50)]
[Column("ADDED_WHO")]
public string? AddedWho { get; set; }
public string
#if NET7_0_OR_GREATER
?
#endif
AddedWho { get; set; }
[StringLength(50)]
[Column("CHANGED_WHO")]
public string? ChangedWho { get; set; }
public string
#if NET7_0_OR_GREATER
?
#endif
ChangedWho { get; set; }
//TODO: assign it to default value in create dto, not here!
[Column("ADDED_WHEN", TypeName = "datetime")]

View File

@@ -1,12 +1,14 @@
using DigitalData.Core.Abstractions;
using System.ComponentModel;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
#if NETFRAMEWORK
using System;
#endif
namespace DigitalData.UserManager.Domain.Entities
{
[Table("TBDD_CLIENT_USER", Schema = "dbo")]
public class ClientUser : IUnique<int>
public class ClientUser
{
[Column("GUID")]
[Key]
@@ -15,18 +17,26 @@ namespace DigitalData.UserManager.Domain.Entities
[Required]
[Column("USER_ID")]
public int UserId { get; init; }
public int UserId { get; set; }
[Required]
[Column("CLIENT_ID")]
public int ClientId { get; init; }
public int ClientId { get; set; }
[Column("COMMENT")]
public string? Comment { get; init; }
public string
#if NET7_0_OR_GREATER
?
#endif
Comment { get; set; }
[StringLength(50)]
[Column("ADDED_WHO")]
public string? AddedWho { get; set; }
public string
#if NET7_0_OR_GREATER
?
#endif
AddedWho { get; set; }
[Column("ADDED_WHEN", TypeName = "datetime")]
[DefaultValue("GETDATE()")]

View File

@@ -8,7 +8,11 @@ namespace DigitalData.UserManager.Domain.Entities
public class Group : BaseEntity
{
[StringLength(50)]
public string? Name { get; set; }
public string
#if NET7_0_OR_GREATER
?
#endif
Name { get; set; }
[Required]
[DefaultValue(false)]
@@ -24,12 +28,16 @@ namespace DigitalData.UserManager.Domain.Entities
public bool Active { get; set; }
[StringLength(200)]
public string? Comment { get; set; }
public string
#if NET7_0_OR_GREATER
?
#endif
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]
[Column("ECM_FK_ID")]
[DefaultValue(-1)]
public int EcmFkId { get; init; } = -1;
public int EcmFkId { get; set; } = -1;
}
}

View File

@@ -15,12 +15,24 @@ namespace DigitalData.UserManager.Domain.Entities
public int GroupId { get; set; }
[StringLength(200)]
public string? Comment { get; set; }
public string
#if NET7_0_OR_GREATER
?
#endif
Comment { get; set; }
[ForeignKey("UserId")]
public virtual User? User { get; set; }
public virtual User
#if NET7_0_OR_GREATER
?
#endif
User { get; set; }
[ForeignKey("GroupId")]
public virtual Group? Group { get; set; }
public virtual Group
#if NET7_0_OR_GREATER
?
#endif
Group { get; set; }
}
}
}

View File

@@ -1,11 +1,10 @@
using DigitalData.Core.Abstractions;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace DigitalData.UserManager.Domain.Entities
{
[Table("TBDD_MODULES", Schema = "dbo")]
public class Module : IUnique<int>
public class Module
{
[Column("GUID")]
[Key]
@@ -13,11 +12,19 @@ namespace DigitalData.UserManager.Domain.Entities
public int Id { get; set; }
[StringLength(50)]
public string? Name { get; set; }
public string
#if NET7_0_OR_GREATER
?
#endif
Name { get; set; }
[StringLength(20)]
[Column("SHORT_NAME")]
public string? ShortName { get; set; }
public string
#if NET7_0_OR_GREATER
?
#endif
ShortName { get; set; }
#region IGNORED COLUMNS
//[Required]

View File

@@ -1,11 +1,10 @@
using DigitalData.Core.Abstractions;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace DigitalData.UserManager.Domain.Entities
{
[Table("TBDD_USER_MODULES", Schema = "dbo")]
public class ModuleOfUser : IUnique<int>
public class ModuleOfUser
{
[Column("GUID")]
[Key]
@@ -22,21 +21,41 @@ namespace DigitalData.UserManager.Domain.Entities
[Column("COMMENT")]
[StringLength(200)]
public string? Comment { get; set; }
public string
#if NET7_0_OR_GREATER
?
#endif
Comment { get; set; }
[Column("ADDED_WHO")]
[StringLength(50)]
public string? AddedWho { get; set; } = "DEFAULT";
public string
#if NET7_0_OR_GREATER
?
#endif
AddedWho { get; set; } = "DEFAULT";
[Column("CHANGED_WHO")]
[StringLength(50)]
public string? ChangedWho { get; set; }
public string
#if NET7_0_OR_GREATER
?
#endif
ChangedWho { get; set; }
[ForeignKey("UserId")]
public virtual User? User { get; set; }
public virtual User
#if NET7_0_OR_GREATER
?
#endif
User { get; set; }
[ForeignKey("ModuleId")]
public virtual Module? Module { get; set; }
public virtual Module
#if NET7_0_OR_GREATER
?
#endif
Module { get; set; }
#region IGNORED COLUMNS
//public bool IsAdmin { get; set; }
@@ -54,5 +73,4 @@ namespace DigitalData.UserManager.Domain.Entities
//public DateTime? ChangedWhen { get; set; }
#endregion
}
}

View File

@@ -1,42 +1,74 @@
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
#if NETFRAMEWORK
using System;
#endif
namespace DigitalData.UserManager.Domain.Entities
{
[Table("TBDD_USER", Schema = "dbo")]
public class User : BaseEntity
public partial class User : BaseEntity
{
[Column("PRENAME")]
[StringLength(50)]
public string? Prename { get; set; }
public string
#if NET7_0_OR_GREATER
?
#endif
Prename { get; set; }
[Column("NAME")]
[StringLength(50)]
public string? Name { get; set; }
public string
#if NET7_0_OR_GREATER
?
#endif
Name { get; set; }
[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? Shortname { get; set; }
public string
#if NET7_0_OR_GREATER
?
#endif
Shortname
{ get; set; }
[Column("EMAIL")]
[StringLength(100)]
public string? Email { get; set; }
public string
#if NET7_0_OR_GREATER
?
#endif
Email { get; set; }
[Required]
[Column("LANGUAGE")]
[StringLength(5)]
[DefaultValue("de-DE")]
public string Language { get; set; }
public string
#if NET7_0_OR_GREATER
?
#endif
Language { get; set; }
[Column("COMMENT")]
[StringLength(500)]
public string? Comment { get; set; }
public string
#if NET7_0_OR_GREATER
?
#endif
Comment { get; set; }
[Column("DELETED")]
public bool Deleted { get; set; }
@@ -45,33 +77,51 @@ 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")]
public bool Active { get; set; }
#region IGNORED COLUMNS
//[Required]
//[Column("GENERAL_VIEWER")]
//[StringLength(30)]
//[DefaultValue("NONE")]
//public string GeneralViewer { get; set; }
[Required]
[Column("GENERAL_VIEWER")]
[StringLength(30)]
[DefaultValue("NONE")]
public
#if NET7_0_OR_GREATER
required
#endif
string GeneralViewer { get; set; }
//[Required]
//[Column("WAN_ENVIRONMENT")]
//public bool WanEnvironment { get; set; }
[Required]
[Column("WAN_ENVIRONMENT")]
public bool WanEnvironment { get; set; }
//[Required]
//[Column("USERID_FK_INT_ECM")]
//public int UseridFkIntEcm { get; set; }
[Required]
[Column("USERID_FK_INT_ECM")]
public int UserIdFkIntEcm { get; set; }
//[Column("DELETED_WHEN")]
//public DateTime? DeletedWhen { get; set; }
[Column("DELETED_WHEN")]
public DateTime
#if NET7_0_OR_GREATER
?
#endif
DeletedWhen { get; set; }
//[Column("DELETED_WHO")]
//[StringLength(50)]
//public string? DeletedWho { get; set; }
#endregion
[Column("DELETED_WHO")]
[StringLength(50)]
public
#if NET7_0_OR_GREATER
required
#endif
string
#if NET7_0_OR_GREATER
?
# endif
DeletedWho { get; set; }
}
}

View File

@@ -1,5 +1,7 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations.Schema;
#if NETFRAMEWORK
using System;
#endif
namespace DigitalData.UserManager.Domain.Entities
{
@@ -25,15 +27,31 @@ namespace DigitalData.UserManager.Domain.Entities
public DateTime? ValidTo { get; set; }
[ForeignKey("UserId")]
public virtual User? User { get; set; }
public virtual User
#if NET7_0_OR_GREATER
?
#endif
User { get; set; }
[ForeignKey("RepGroupId")]
public virtual Group? RepGroup { get; set; }
public virtual Group
#if NET7_0_OR_GREATER
?
#endif
RepGroup { get; set; }
[ForeignKey("GroupId")]
public virtual Group? Group { get; set; }
public virtual Group
#if NET7_0_OR_GREATER
?
#endif
Group { get; set; }
[ForeignKey("RepUserId")]
public virtual User? RepUser { get; set; }
public virtual User
#if NET7_0_OR_GREATER
?
#endif
RepUser { get; set; }
}
}

View File

@@ -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>();
}
}

View File

@@ -5,7 +5,6 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PackageId>UserManager.Infrastructure</PackageId>
<Version>3.0.2</Version>
<Authors>Digital Data GmbH</Authors>
<Company>Digital Data GmbH</Company>
<Product>UserManager.Infrastructure</Product>
@@ -14,8 +13,9 @@
<PackageIcon>icon.png</PackageIcon>
<RepositoryUrl>http://git.dd:3000/AppStd/WebUserManager.git</RepositoryUrl>
<PackageTags>digital data infrastructure user maanger</PackageTags>
<AssemblyVersion>3.0.2</AssemblyVersion>
<FileVersion>3.0.2</FileVersion>
<Version>3.1.1</Version>
<AssemblyVersion>3.1.1</AssemblyVersion>
<FileVersion>3.1.1</FileVersion>
</PropertyGroup>
<ItemGroup>
@@ -26,7 +26,8 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="DigitalData.Core.Infrastructure" Version="2.0.1" />
<PackageReference Include="DigitalData.Core.Abstraction.Application" Version="1.0.0" />
<PackageReference Include="DigitalData.Core.Infrastructure" Version="2.1.1" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
@@ -40,7 +41,7 @@
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="9.0.4" />
</ItemGroup>

View File

@@ -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
{

View File

@@ -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
{

View File

@@ -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
{

View File

@@ -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
{

View File

@@ -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
{

View File

@@ -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
{

View File

@@ -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
{

Some files were not shown because too many files have changed in this diff Show More