diff --git a/src/WorkFlow.API/Controllers/ConfigController.cs b/src/WorkFlow.API/Controllers/ConfigController.cs index 43e0362..cd7e54d 100644 --- a/src/WorkFlow.API/Controllers/ConfigController.cs +++ b/src/WorkFlow.API/Controllers/ConfigController.cs @@ -12,6 +12,7 @@ namespace WorkFlow.API.Controllers; [Route("api/[controller]")] [ApiController] [Authorize] +[Obsolete("Use MediatR")] public class ConfigController : CRUDControllerBaseWithErrorHandling { public ConfigController(ILogger logger, IConfigService service) : base(logger, service) diff --git a/src/WorkFlow.API/Controllers/ProfileControlsTFController.cs b/src/WorkFlow.API/Controllers/ProfileControlsTFController.cs index 398be16..17d4bf2 100644 --- a/src/WorkFlow.API/Controllers/ProfileControlsTFController.cs +++ b/src/WorkFlow.API/Controllers/ProfileControlsTFController.cs @@ -1,5 +1,5 @@ -using DigitalData.Core.API; -using DigitalData.Core.DTO; +using DigitalData.Core.Abstraction.Application.DTO; +using DigitalData.Core.API; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using WorkFlow.API.Attributes; @@ -13,6 +13,7 @@ namespace WorkFlow.API.Controllers; [Route("api/[controller]")] [ApiController] [Authorize] +[Obsolete("Use MediatR")] public class ProfileControlsTFController : CRUDControllerBase { diff --git a/src/WorkFlow.API/Controllers/ProfileObjStateController.cs b/src/WorkFlow.API/Controllers/ProfileObjStateController.cs index 211e140..c5cef53 100644 --- a/src/WorkFlow.API/Controllers/ProfileObjStateController.cs +++ b/src/WorkFlow.API/Controllers/ProfileObjStateController.cs @@ -1,5 +1,5 @@ -using DigitalData.Core.API; -using DigitalData.Core.DTO; +using DigitalData.Core.Abstraction.Application.DTO; +using DigitalData.Core.API; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using WorkFlow.API.Attributes; @@ -7,106 +7,106 @@ using WorkFlow.Application.Contracts; using WorkFlow.Application.Dto.ProfileObjState; using WorkFlow.Domain.Entities; -namespace WorkFlow.API.Controllers +namespace WorkFlow.API.Controllers; + +[APIKeyAuth] +[Route("api/[controller]")] +[ApiController] +[Authorize] +[Obsolete("Use MediatR")] +public class ProfileObjStateController : CRUDControllerBaseWithErrorHandling { - [APIKeyAuth] - [Route("api/[controller]")] - [ApiController] - [Authorize] - public class ProfileObjStateController : CRUDControllerBaseWithErrorHandling + private readonly ILogger logger; + + public ProfileObjStateController(ILogger logger, IProfileObjStateService service) : base(logger, service) { - private readonly ILogger logger; + this.logger = logger; + } - public ProfileObjStateController(ILogger logger, IProfileObjStateService service) : base(logger, service) + [NonAction] + public override Task GetAll() => base.GetAll(); + + [NonAction] + public override Task Update(ProfileObjStateUpdateDto updateDto) => base.Update(updateDto); + + [HttpGet] + public async Task GetAsync( + bool withProfile = true, bool withUser = true, bool withState = true, + int? profileId = null, int? objId = null, bool? profileActive = null) + { + try { - this.logger = logger; - } - - [NonAction] - public override Task GetAll() => base.GetAll(); - - [NonAction] - public override Task Update(ProfileObjStateUpdateDto updateDto) => base.Update(updateDto); - - [HttpGet] - public async Task GetAsync( - bool withProfile = true, bool withUser = true, bool withState = true, - int? profileId = null, int? objId = null, bool? profileActive = null) - { - try + if (!User.TryGetUserId(out var id)) { - if (!User.TryGetUserId(out var id)) - { - logger.LogError("Authorization failed: User ID claim not found."); - return Unauthorized("Failed to retrieve user identity."); - } - - return await _service.ReadAsync( - withProfile: withProfile, withUser: withUser, withState, - userId: id, - profileId: profileId, objId: objId) - .ThenAsync( - Success: pctf => pctf.Any() ? Ok(pctf) : NotFound(), - Fail: IActionResult (msg, ntc) => - { - logger.LogNotice(ntc); - return NotFound(); - }); + logger.LogError("Authorization failed: User ID claim not found."); + return Unauthorized("Failed to retrieve user identity."); } - catch (Exception ex) - { - logger.LogError(ex, "An unexpected error occurred while processing the request: {Message}", ex.Message); - return StatusCode(StatusCodes.Status500InternalServerError, "An internal server error occurred."); - } - } - [HttpPost] - public override async Task Create([FromBody] ProfileObjStateCreateDto createDto) - { - try - { - if (!User.TryGetUserId(out var id)) - { - logger.LogError("Authorization failed: User ID claim not found."); - return StatusCode(StatusCodes.Status500InternalServerError, "Failed to retrieve user identity."); - } - - if (createDto.UserId != id) - return Unauthorized(); - - return await base.Create(createDto); - } - catch (Exception ex) - { - logger.LogError(ex, "An unexpected error occurred while processing the request: {Message}", ex.Message); - return StatusCode(StatusCodes.Status500InternalServerError, "An internal server error occurred."); - } - } - - [HttpDelete] - public override async Task Delete([FromRoute] long id) - { - try - { - if (!User.TryGetUserId(out var userId)) - { - logger.LogError("Authorization failed: User ID claim not found."); - return StatusCode(StatusCodes.Status500InternalServerError, "Failed to retrieve user identity."); - } - - return await _service.ReadByIdAsync(id).ThenAsync( - SuccessAsync: async pctf => pctf.UserId == userId ? await base.Delete(id) : Unauthorized(), + return await _service.ReadAsync( + withProfile: withProfile, withUser: withUser, withState, + userId: id, + profileId: profileId, objId: objId) + .ThenAsync( + Success: pctf => pctf.Any() ? Ok(pctf) : NotFound(), Fail: IActionResult (msg, ntc) => { - _logger.LogNotice(ntc); - return ntc.HasFlag(Flag.NotFound) ? NotFound() : StatusCode(StatusCodes.Status500InternalServerError); + logger.LogNotice(ntc); + return NotFound(); }); - } - catch (Exception ex) + } + catch (Exception ex) + { + logger.LogError(ex, "An unexpected error occurred while processing the request: {Message}", ex.Message); + return StatusCode(StatusCodes.Status500InternalServerError, "An internal server error occurred."); + } + } + + [HttpPost] + public override async Task Create([FromBody] ProfileObjStateCreateDto createDto) + { + try + { + if (!User.TryGetUserId(out var id)) { - logger.LogError(ex, "An unexpected error occurred while processing the request: {Message}", ex.Message); - return StatusCode(StatusCodes.Status500InternalServerError, "An internal server error occurred."); + logger.LogError("Authorization failed: User ID claim not found."); + return StatusCode(StatusCodes.Status500InternalServerError, "Failed to retrieve user identity."); } + + if (createDto.UserId != id) + return Unauthorized(); + + return await base.Create(createDto); + } + catch (Exception ex) + { + logger.LogError(ex, "An unexpected error occurred while processing the request: {Message}", ex.Message); + return StatusCode(StatusCodes.Status500InternalServerError, "An internal server error occurred."); + } + } + + [HttpDelete] + public override async Task Delete([FromRoute] long id) + { + try + { + if (!User.TryGetUserId(out var userId)) + { + logger.LogError("Authorization failed: User ID claim not found."); + return StatusCode(StatusCodes.Status500InternalServerError, "Failed to retrieve user identity."); + } + + return await _service.ReadByIdAsync(id).ThenAsync( + SuccessAsync: async pctf => pctf.UserId == userId ? await base.Delete(id) : Unauthorized(), + Fail: IActionResult (msg, ntc) => + { + _logger.LogNotice(ntc); + return ntc.HasFlag(Flag.NotFound) ? NotFound() : StatusCode(StatusCodes.Status500InternalServerError); + }); + } + catch (Exception ex) + { + logger.LogError(ex, "An unexpected error occurred while processing the request: {Message}", ex.Message); + return StatusCode(StatusCodes.Status500InternalServerError, "An internal server error occurred."); } } } \ No newline at end of file diff --git a/src/WorkFlow.API/Controllers/StateController.cs b/src/WorkFlow.API/Controllers/StateController.cs index e8f735f..a43f38a 100644 --- a/src/WorkFlow.API/Controllers/StateController.cs +++ b/src/WorkFlow.API/Controllers/StateController.cs @@ -12,6 +12,7 @@ namespace WorkFlow.API.Controllers; [Route("api/[controller]")] [ApiController] [Authorize] +[Obsolete("Use MediatR")] public class StateController : CRUDControllerBaseWithErrorHandling { public StateController(ILogger logger, IStateService service) : base(logger, service) diff --git a/src/WorkFlow.API/Controllers/UserController.cs b/src/WorkFlow.API/Controllers/UserController.cs index 8cf9ebd..a1185d4 100644 --- a/src/WorkFlow.API/Controllers/UserController.cs +++ b/src/WorkFlow.API/Controllers/UserController.cs @@ -1,4 +1,4 @@ -using DigitalData.Core.DTO; +using DigitalData.Core.Abstraction.Application.DTO; using DigitalData.UserManager.Application.Contracts; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; @@ -10,6 +10,7 @@ namespace WorkFlow.API.Controllers; [Route("api/[controller]")] [ApiController] [Authorize] +[Obsolete("Use MediatR")] public class UserController : ControllerBase { private readonly ILogger logger; diff --git a/src/WorkFlow.API/Program.cs b/src/WorkFlow.API/Program.cs index c160908..1777b98 100644 --- a/src/WorkFlow.API/Program.cs +++ b/src/WorkFlow.API/Program.cs @@ -1,5 +1,4 @@ using WorkFlow.Application; -using DigitalData.UserManager.Application; using Microsoft.EntityFrameworkCore; using WorkFlow.Infrastructure; using DigitalData.Core.API; @@ -16,8 +15,8 @@ using DigitalData.Auth.Client; using Microsoft.AspNetCore.Authentication.JwtBearer; using WorkFlow.API; using Microsoft.Extensions.Options; -using DigitalData.Core.Abstractions.Security; using DigitalData.Core.Abstractions.Security.Extensions; +using DigitalData.UserManager.DependencyInjection; var logger = LogManager.Setup().LoadConfigurationFromAppSettings().GetCurrentClassLogger(); logger.Info("Logging initialized."); @@ -48,7 +47,10 @@ try ?? throw new InvalidOperationException( "The 'MediatRLicense' configuration value is missing or empty." + "Please ensure it is properly set in the configuration source."); - builder.Services.AddWorkFlowServices(opt => opt.MediatRLicense = mediatRLicense).AddWorkFlowRepositories().AddUserManager(); + builder.Services.AddWorkFlowServices(opt => opt.MediatRLicense = mediatRLicense).AddWorkFlowRepositories(); + + builder.Services.AddUserManager(); + builder.Services.AddCookieBasedLocalizer(); builder.Services.AddDirectorySearchService(config.GetSection("DirectorySearchOptions")); builder.Services.AddJWTService(user => new SecurityTokenDescriptor() diff --git a/src/WorkFlow.API/WorkFlow.API.csproj b/src/WorkFlow.API/WorkFlow.API.csproj index df40e56..c566ac3 100644 --- a/src/WorkFlow.API/WorkFlow.API.csproj +++ b/src/WorkFlow.API/WorkFlow.API.csproj @@ -21,11 +21,13 @@ - + + + diff --git a/src/WorkFlow.Application/Buttons/ReadButton.cs b/src/WorkFlow.Application/Buttons/ReadButton.cs index 583ece8..015a242 100644 --- a/src/WorkFlow.Application/Buttons/ReadButton.cs +++ b/src/WorkFlow.Application/Buttons/ReadButton.cs @@ -1,9 +1,8 @@ -using DigitalData.Core.Abstractions; -using MediatR; +using MediatR; namespace WorkFlow.Application.Buttons; -public record ButtonDto : IUnique +public record ButtonDto { public int Id { get; init; } diff --git a/src/WorkFlow.Application/Contracts/IConfigService.cs b/src/WorkFlow.Application/Contracts/IConfigService.cs index 03a482c..e5fe1e9 100644 --- a/src/WorkFlow.Application/Contracts/IConfigService.cs +++ b/src/WorkFlow.Application/Contracts/IConfigService.cs @@ -1,10 +1,10 @@ -using DigitalData.Core.Abstractions.Application; +using DigitalData.Core.Abstraction.Application; using WorkFlow.Application.Dto.Config; using WorkFlow.Domain.Entities; -namespace WorkFlow.Application.Contracts +namespace WorkFlow.Application.Contracts; + +[Obsolete("Use MediatR")] +public interface IConfigService : ICRUDService { - public interface IConfigService : ICRUDService - { - } } \ No newline at end of file diff --git a/src/WorkFlow.Application/Contracts/IProfileControlsTFService.cs b/src/WorkFlow.Application/Contracts/IProfileControlsTFService.cs index 3b03e8f..704a355 100644 --- a/src/WorkFlow.Application/Contracts/IProfileControlsTFService.cs +++ b/src/WorkFlow.Application/Contracts/IProfileControlsTFService.cs @@ -1,9 +1,10 @@ -using DigitalData.Core.Abstractions.Application; +using DigitalData.Core.Abstraction.Application; using WorkFlow.Application.Dto.ProfileControlsTF; using WorkFlow.Domain.Entities; namespace WorkFlow.Application.Contracts; +[Obsolete("Use MediatR")] public interface IProfileControlsTFService : ICRUDService { } \ No newline at end of file diff --git a/src/WorkFlow.Application/Contracts/IProfileObjStateService.cs b/src/WorkFlow.Application/Contracts/IProfileObjStateService.cs index 9b0d116..9ebf7c9 100644 --- a/src/WorkFlow.Application/Contracts/IProfileObjStateService.cs +++ b/src/WorkFlow.Application/Contracts/IProfileObjStateService.cs @@ -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 WorkFlow.Application.Dto.ProfileObjState; using WorkFlow.Domain.Entities; namespace WorkFlow.Application.Contracts; +[Obsolete("Use MediatR")] public interface IProfileObjStateService : ICRUDService { Task>> ReadAsync( diff --git a/src/WorkFlow.Application/Contracts/IStateService.cs b/src/WorkFlow.Application/Contracts/IStateService.cs index bc84a0e..979556d 100644 --- a/src/WorkFlow.Application/Contracts/IStateService.cs +++ b/src/WorkFlow.Application/Contracts/IStateService.cs @@ -1,10 +1,10 @@ -using DigitalData.Core.Abstractions.Application; +using DigitalData.Core.Abstraction.Application; using WorkFlow.Application.Dto.State; using WorkFlow.Domain.Entities; -namespace WorkFlow.Application.Contracts +namespace WorkFlow.Application.Contracts; + +[Obsolete("Use MediatR")] +public interface IStateService : ICRUDService { - public interface IStateService : ICRUDService - { - } } \ No newline at end of file diff --git a/src/WorkFlow.Application/Contracts/Repositories/IButtonRepository.cs b/src/WorkFlow.Application/Contracts/Repositories/IButtonRepository.cs index b8f28ce..e9be586 100644 --- a/src/WorkFlow.Application/Contracts/Repositories/IButtonRepository.cs +++ b/src/WorkFlow.Application/Contracts/Repositories/IButtonRepository.cs @@ -1,8 +1,9 @@ -using DigitalData.Core.Abstractions.Infrastructure; +using DigitalData.Core.Abstraction.Application.Repository; using WorkFlow.Domain.Entities; namespace WorkFlow.Application.Contracts.Repositories; +[Obsolete("Use IRepository")] public interface IButtonRepository : ICRUDRepository { public Task> ReadAllAsync(int profileId); diff --git a/src/WorkFlow.Application/Contracts/Repositories/IConfigRepository.cs b/src/WorkFlow.Application/Contracts/Repositories/IConfigRepository.cs index ff54e85..6e61dfc 100644 --- a/src/WorkFlow.Application/Contracts/Repositories/IConfigRepository.cs +++ b/src/WorkFlow.Application/Contracts/Repositories/IConfigRepository.cs @@ -1,8 +1,9 @@ -using DigitalData.Core.Abstractions.Infrastructure; +using DigitalData.Core.Abstraction.Application.Repository; using WorkFlow.Domain.Entities; namespace WorkFlow.Application.Contracts.Repositories; +[Obsolete("Use IRepository")] public interface IConfigRepository : ICRUDRepository { } \ No newline at end of file diff --git a/src/WorkFlow.Application/Contracts/Repositories/IProfileControlsTFRepository.cs b/src/WorkFlow.Application/Contracts/Repositories/IProfileControlsTFRepository.cs index 3589f36..b927058 100644 --- a/src/WorkFlow.Application/Contracts/Repositories/IProfileControlsTFRepository.cs +++ b/src/WorkFlow.Application/Contracts/Repositories/IProfileControlsTFRepository.cs @@ -1,8 +1,9 @@ -using DigitalData.Core.Abstractions.Infrastructure; +using DigitalData.Core.Abstraction.Application.Repository; using WorkFlow.Domain.Entities; namespace WorkFlow.Application.Contracts.Repositories; +[Obsolete("Use IRepository")] public interface IProfileControlsTFRepository : ICRUDRepository { } \ No newline at end of file diff --git a/src/WorkFlow.Application/Contracts/Repositories/IProfileObjStateRepository.cs b/src/WorkFlow.Application/Contracts/Repositories/IProfileObjStateRepository.cs index 0c359b0..f078f5d 100644 --- a/src/WorkFlow.Application/Contracts/Repositories/IProfileObjStateRepository.cs +++ b/src/WorkFlow.Application/Contracts/Repositories/IProfileObjStateRepository.cs @@ -1,8 +1,9 @@ -using DigitalData.Core.Abstractions.Infrastructure; +using DigitalData.Core.Abstraction.Application.Repository; using WorkFlow.Domain.Entities; namespace WorkFlow.Application.Contracts.Repositories; +[Obsolete("Use IRepository")] public interface IProfileObjStateRepository : ICRUDRepository { Task> ReadAsync( diff --git a/src/WorkFlow.Application/Contracts/Repositories/IStateRepository.cs b/src/WorkFlow.Application/Contracts/Repositories/IStateRepository.cs index f34bdc1..4af9f48 100644 --- a/src/WorkFlow.Application/Contracts/Repositories/IStateRepository.cs +++ b/src/WorkFlow.Application/Contracts/Repositories/IStateRepository.cs @@ -1,8 +1,9 @@ -using DigitalData.Core.Abstractions.Infrastructure; +using DigitalData.Core.Abstraction.Application.Repository; using WorkFlow.Domain.Entities; namespace WorkFlow.Application.Contracts.Repositories; +[Obsolete("Use IRepository")] public interface IStateRepository : ICRUDRepository { } \ No newline at end of file diff --git a/src/WorkFlow.Application/DTO/BaseUpdateDto.cs b/src/WorkFlow.Application/DTO/BaseUpdateDto.cs index 6f4d7f8..3a774b3 100644 --- a/src/WorkFlow.Application/DTO/BaseUpdateDto.cs +++ b/src/WorkFlow.Application/DTO/BaseUpdateDto.cs @@ -1,9 +1,8 @@ -using DigitalData.Core.Abstractions; -using System.Text.Json.Serialization; +using System.Text.Json.Serialization; namespace WorkFlow.Application.Dto { - public record BaseUpdateDto : IUnique + public record BaseUpdateDto { public required int Id { get; init; } diff --git a/src/WorkFlow.Application/DTO/ProfileControlsTF/ProfileControlsTFUpdateDto.cs b/src/WorkFlow.Application/DTO/ProfileControlsTF/ProfileControlsTFUpdateDto.cs index 508713b..74541a7 100644 --- a/src/WorkFlow.Application/DTO/ProfileControlsTF/ProfileControlsTFUpdateDto.cs +++ b/src/WorkFlow.Application/DTO/ProfileControlsTF/ProfileControlsTFUpdateDto.cs @@ -1,9 +1,6 @@ -using DigitalData.Core.Abstractions; +namespace WorkFlow.Application.Dto.ProfileControlsTF; -namespace WorkFlow.Application.Dto.ProfileControlsTF -{ - /// - /// This Data Transfer Object (DTO) serves as a placeholder and does not support updates. - /// - public record ProfileControlsTFUpdateDto(long Id) : IUnique; -} \ No newline at end of file +/// +/// This Data Transfer Object (DTO) serves as a placeholder and does not support updates. +/// +public record ProfileControlsTFUpdateDto(long Id); \ No newline at end of file diff --git a/src/WorkFlow.Application/DTO/ProfileObjState/ProfileObjStateUpdateDto.cs b/src/WorkFlow.Application/DTO/ProfileObjState/ProfileObjStateUpdateDto.cs index c797df0..eae423b 100644 --- a/src/WorkFlow.Application/DTO/ProfileObjState/ProfileObjStateUpdateDto.cs +++ b/src/WorkFlow.Application/DTO/ProfileObjState/ProfileObjStateUpdateDto.cs @@ -1,9 +1,6 @@ -using DigitalData.Core.Abstractions; +namespace WorkFlow.Application.Dto.ProfileObjState; -namespace WorkFlow.Application.Dto.ProfileObjState -{ - /// - /// This Data Transfer Object (DTO) serves as a placeholder and does not support updates. - /// - public record ProfileObjStateUpdateDto(long Id) : IUnique; -} \ No newline at end of file +/// +/// This Data Transfer Object (DTO) serves as a placeholder and does not support updates. +/// +public record ProfileObjStateUpdateDto(long Id); \ No newline at end of file diff --git a/src/WorkFlow.Application/DTO/State/StateUpdateDto.cs b/src/WorkFlow.Application/DTO/State/StateUpdateDto.cs index 196a2d2..b475324 100644 --- a/src/WorkFlow.Application/DTO/State/StateUpdateDto.cs +++ b/src/WorkFlow.Application/DTO/State/StateUpdateDto.cs @@ -1,9 +1,6 @@ -using DigitalData.Core.Abstractions; +namespace WorkFlow.Application.Dto.State; -namespace WorkFlow.Application.Dto.State -{ - /// - /// This Data Transfer Object (DTO) serves as a placeholder and does not support updates. - /// - public record StateUpdateDto(int Id) : IUnique; -} \ No newline at end of file +/// +/// This Data Transfer Object (DTO) serves as a placeholder and does not support updates. +/// +public record StateUpdateDto(int Id); \ No newline at end of file diff --git a/src/WorkFlow.Application/DependencyInjection.cs b/src/WorkFlow.Application/DependencyInjection.cs index ece80c0..0c46e73 100644 --- a/src/WorkFlow.Application/DependencyInjection.cs +++ b/src/WorkFlow.Application/DependencyInjection.cs @@ -7,6 +7,7 @@ namespace WorkFlow.Application; public static class DependencyInjection { + [Obsolete("Use MediatR")] public static IServiceCollection AddWorkFlowServices(this IServiceCollection services, Action? options = null) { WorkFlowServiceOptions diOptions = new(); diff --git a/src/WorkFlow.Application/Services/ConfigService.cs b/src/WorkFlow.Application/Services/ConfigService.cs index ec26876..7927ce0 100644 --- a/src/WorkFlow.Application/Services/ConfigService.cs +++ b/src/WorkFlow.Application/Services/ConfigService.cs @@ -1,13 +1,14 @@ using AutoMapper; -using DigitalData.Core.Abstractions.Application; using DigitalData.Core.Application; using WorkFlow.Application.Contracts; using WorkFlow.Application.Dto.Config; using WorkFlow.Domain.Entities; using WorkFlow.Application.Contracts.Repositories; +using DigitalData.Core.Abstraction.Application; namespace WorkFlow.Application.Services; +[Obsolete("Use MediatR")] public class ConfigService : CRUDService, IConfigService, ICRUDService { diff --git a/src/WorkFlow.Application/Services/ProfileControlsTFService.cs b/src/WorkFlow.Application/Services/ProfileControlsTFService.cs index e6ff532..1f1969c 100644 --- a/src/WorkFlow.Application/Services/ProfileControlsTFService.cs +++ b/src/WorkFlow.Application/Services/ProfileControlsTFService.cs @@ -1,24 +1,24 @@ using AutoMapper; -using DigitalData.Core.Abstractions.Application; using DigitalData.Core.Application; -using DigitalData.Core.DTO; using WorkFlow.Application.Contracts; using WorkFlow.Application.Dto.ProfileControlsTF; using WorkFlow.Domain.Entities; using WorkFlow.Application.Contracts.Repositories; +using DigitalData.Core.Abstraction.Application; +using DigitalData.Core.Abstraction.Application.DTO; -namespace WorkFlow.Application.Services +namespace WorkFlow.Application.Services; + +[Obsolete("Use MediatR")] +public class ProfileControlsTFService : CRUDService, + IProfileControlsTFService, ICRUDService { - public class ProfileControlsTFService : CRUDService, - IProfileControlsTFService, ICRUDService + public ProfileControlsTFService(IProfileControlsTFRepository repository, IMapper mapper) : base(repository, mapper) { - public ProfileControlsTFService(IProfileControlsTFRepository repository, IMapper mapper) : base(repository, mapper) - { - } + } - public Task>> ReadAsync(bool withProfile = true, bool withUser = false, int? userId = null, string? username = null, int? profileId = null, int? objId = null, bool? profileActive = null) - { - throw new NotImplementedException(); - } + public Task>> ReadAsync(bool withProfile = true, bool withUser = false, int? userId = null, string? username = null, int? profileId = null, int? objId = null, bool? profileActive = null) + { + throw new NotImplementedException(); } } \ No newline at end of file diff --git a/src/WorkFlow.Application/Services/ProfileObjStateService.cs b/src/WorkFlow.Application/Services/ProfileObjStateService.cs index 26af8be..71102ea 100644 --- a/src/WorkFlow.Application/Services/ProfileObjStateService.cs +++ b/src/WorkFlow.Application/Services/ProfileObjStateService.cs @@ -1,14 +1,15 @@ using AutoMapper; -using DigitalData.Core.Abstractions.Application; using DigitalData.Core.Application; -using DigitalData.Core.DTO; using WorkFlow.Application.Contracts; using WorkFlow.Application.Dto.ProfileObjState; using WorkFlow.Domain.Entities; using WorkFlow.Application.Contracts.Repositories; +using DigitalData.Core.Abstraction.Application; +using DigitalData.Core.Abstraction.Application.DTO; namespace WorkFlow.Application.Services; +[Obsolete("Use MediatR")] public class ProfileObjStateService : CRUDService, IProfileObjStateService, ICRUDService { diff --git a/src/WorkFlow.Application/Services/StateService.cs b/src/WorkFlow.Application/Services/StateService.cs index 7c8c6f4..6c458e4 100644 --- a/src/WorkFlow.Application/Services/StateService.cs +++ b/src/WorkFlow.Application/Services/StateService.cs @@ -1,13 +1,14 @@ using AutoMapper; -using DigitalData.Core.Abstractions.Application; using DigitalData.Core.Application; using WorkFlow.Application.Contracts; using WorkFlow.Application.Dto.State; using WorkFlow.Domain.Entities; using WorkFlow.Application.Contracts.Repositories; +using DigitalData.Core.Abstraction.Application; namespace WorkFlow.Application.Services; +[Obsolete("Use MediatR")] public class StateService : CRUDService, IStateService, ICRUDService { diff --git a/src/WorkFlow.Application/WorkFlow.Application.csproj b/src/WorkFlow.Application/WorkFlow.Application.csproj index 3e41ebd..32f9ac0 100644 --- a/src/WorkFlow.Application/WorkFlow.Application.csproj +++ b/src/WorkFlow.Application/WorkFlow.Application.csproj @@ -7,9 +7,11 @@ - + + - + + diff --git a/src/WorkFlow.Domain/Entities/Button.cs b/src/WorkFlow.Domain/Entities/Button.cs index 4c9afe0..be0ec3d 100644 --- a/src/WorkFlow.Domain/Entities/Button.cs +++ b/src/WorkFlow.Domain/Entities/Button.cs @@ -1,11 +1,10 @@ -using DigitalData.Core.Abstractions; -using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace WorkFlow.Domain.Entities; [Table("TBMWF_PROF_BUTTONS")] -public class Button: IUnique +public class Button { [Key] [Column("GUID", TypeName = "int")] diff --git a/src/WorkFlow.Domain/Entities/Config.cs b/src/WorkFlow.Domain/Entities/Config.cs index 8495ad3..6919532 100644 --- a/src/WorkFlow.Domain/Entities/Config.cs +++ b/src/WorkFlow.Domain/Entities/Config.cs @@ -1,11 +1,10 @@ -using DigitalData.Core.Abstractions; -using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace WorkFlow.Domain.Entities { [Table("TBMWF_CONFIG", Schema = "dbo")] - public class Config : IUnique + public class Config { [Key] [Column("GUID")] diff --git a/src/WorkFlow.Domain/Entities/ProfileControlsTF.cs b/src/WorkFlow.Domain/Entities/ProfileControlsTF.cs index b1fde79..60e95be 100644 --- a/src/WorkFlow.Domain/Entities/ProfileControlsTF.cs +++ b/src/WorkFlow.Domain/Entities/ProfileControlsTF.cs @@ -1,11 +1,10 @@ -using DigitalData.Core.Abstractions; -using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace WorkFlow.Domain.Entities; [Table("TBMWF_PROF_CONTROLS_TF", Schema = "dbo")] -public class ProfileControlsTF : IUnique +public class ProfileControlsTF { [Key] [Column("GUID", TypeName = "bigint")] diff --git a/src/WorkFlow.Domain/Entities/ProfileObjState.cs b/src/WorkFlow.Domain/Entities/ProfileObjState.cs index c1d3006..65168e0 100644 --- a/src/WorkFlow.Domain/Entities/ProfileObjState.cs +++ b/src/WorkFlow.Domain/Entities/ProfileObjState.cs @@ -1,12 +1,11 @@ -using DigitalData.Core.Abstractions; -using DigitalData.UserManager.Domain.Entities; +using DigitalData.UserManager.Domain.Entities; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace WorkFlow.Domain.Entities; [Table("TBMWF_PROFILE_OBJ_STATE", Schema = "dbo")] -public class ProfileObjState : IUnique +public class ProfileObjState { [Key] [Column("GUID")] diff --git a/src/WorkFlow.Domain/Entities/State.cs b/src/WorkFlow.Domain/Entities/State.cs index 62abba7..8fd1460 100644 --- a/src/WorkFlow.Domain/Entities/State.cs +++ b/src/WorkFlow.Domain/Entities/State.cs @@ -1,11 +1,10 @@ -using DigitalData.Core.Abstractions; -using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace WorkFlow.Domain.Entities { [Table("TBMWF_WF_STATE", Schema = "dbo")] - public class State : IUnique + public class State { [Key] [Column("GUID")] diff --git a/src/WorkFlow.Domain/WorkFlow.Domain.csproj b/src/WorkFlow.Domain/WorkFlow.Domain.csproj index 1d1a2c3..fc6f4c5 100644 --- a/src/WorkFlow.Domain/WorkFlow.Domain.csproj +++ b/src/WorkFlow.Domain/WorkFlow.Domain.csproj @@ -7,7 +7,7 @@ - + diff --git a/src/WorkFlow.Infrastructure/Repositories/ButtonRepository.cs b/src/WorkFlow.Infrastructure/Repositories/ButtonRepository.cs index 5e9d0d1..1677ac8 100644 --- a/src/WorkFlow.Infrastructure/Repositories/ButtonRepository.cs +++ b/src/WorkFlow.Infrastructure/Repositories/ButtonRepository.cs @@ -1,4 +1,4 @@ -using DigitalData.Core.Abstractions.Infrastructure; +using DigitalData.Core.Abstraction.Application.Repository; using DigitalData.Core.Infrastructure; using Microsoft.EntityFrameworkCore; using WorkFlow.Application.Contracts.Repositories; @@ -7,6 +7,7 @@ using WorkFlow.Domain.Entities; namespace WorkFlow.Infrastructure.Repositories; //TODO: Make the db context type generic so that it can be used by other projects with different db contexts. +[Obsolete("Use Repository")] public class ButtonRepository : CRUDRepository, IButtonRepository, ICRUDRepository { public ButtonRepository(WFDBContext dbContext) : base(dbContext, dbContext.Buttons) diff --git a/src/WorkFlow.Infrastructure/Repositories/ConfigRepository.cs b/src/WorkFlow.Infrastructure/Repositories/ConfigRepository.cs index 0b39f29..8240431 100644 --- a/src/WorkFlow.Infrastructure/Repositories/ConfigRepository.cs +++ b/src/WorkFlow.Infrastructure/Repositories/ConfigRepository.cs @@ -1,4 +1,4 @@ -using DigitalData.Core.Abstractions.Infrastructure; +using DigitalData.Core.Abstraction.Application.Repository; using DigitalData.Core.Infrastructure; using WorkFlow.Application.Contracts.Repositories; using WorkFlow.Domain.Entities; @@ -6,6 +6,7 @@ using WorkFlow.Domain.Entities; namespace WorkFlow.Infrastructure.Repositories; //TODO: Make the db context type generic so that it can be used by other projects with different db contexts. +[Obsolete("Use Repository")] public class ConfigRepository : CRUDRepository, IConfigRepository, ICRUDRepository { public ConfigRepository(WFDBContext dbContext) : base(dbContext, dbContext.Configs) diff --git a/src/WorkFlow.Infrastructure/Repositories/ProfileControlsTFRepository.cs b/src/WorkFlow.Infrastructure/Repositories/ProfileControlsTFRepository.cs index dd36375..414e836 100644 --- a/src/WorkFlow.Infrastructure/Repositories/ProfileControlsTFRepository.cs +++ b/src/WorkFlow.Infrastructure/Repositories/ProfileControlsTFRepository.cs @@ -1,11 +1,11 @@ -using DigitalData.Core.Abstractions.Infrastructure; +using DigitalData.Core.Abstraction.Application.Repository; using DigitalData.Core.Infrastructure; -using Microsoft.EntityFrameworkCore; using WorkFlow.Application.Contracts.Repositories; using WorkFlow.Domain.Entities; namespace WorkFlow.Infrastructure.Repositories; +[Obsolete("Use Repository")] public class ProfileControlsTFRepository : CRUDRepository, IProfileControlsTFRepository, ICRUDRepository { public ProfileControlsTFRepository(WFDBContext dbContext) : base(dbContext, dbContext.ProfileControlsTFs) diff --git a/src/WorkFlow.Infrastructure/Repositories/ProfileObjStateRepository.cs b/src/WorkFlow.Infrastructure/Repositories/ProfileObjStateRepository.cs index d150a22..51ae99e 100644 --- a/src/WorkFlow.Infrastructure/Repositories/ProfileObjStateRepository.cs +++ b/src/WorkFlow.Infrastructure/Repositories/ProfileObjStateRepository.cs @@ -1,4 +1,4 @@ -using DigitalData.Core.Abstractions.Infrastructure; +using DigitalData.Core.Abstraction.Application.Repository; using DigitalData.Core.Infrastructure; using Microsoft.EntityFrameworkCore; using WorkFlow.Application.Contracts.Repositories; @@ -6,6 +6,7 @@ using WorkFlow.Domain.Entities; namespace WorkFlow.Infrastructure.Repositories; +[Obsolete("Use Repository")] public class ProfileObjStateRepository : CRUDRepository, IProfileObjStateRepository, ICRUDRepository { public ProfileObjStateRepository(WFDBContext dbContext) : base(dbContext, dbContext.ProfileObjStates) diff --git a/src/WorkFlow.Infrastructure/Repositories/StateRepository.cs b/src/WorkFlow.Infrastructure/Repositories/StateRepository.cs index a7c99ce..589ebfb 100644 --- a/src/WorkFlow.Infrastructure/Repositories/StateRepository.cs +++ b/src/WorkFlow.Infrastructure/Repositories/StateRepository.cs @@ -1,10 +1,11 @@ -using DigitalData.Core.Abstractions.Infrastructure; +using DigitalData.Core.Abstraction.Application.Repository; using DigitalData.Core.Infrastructure; using WorkFlow.Application.Contracts.Repositories; using WorkFlow.Domain.Entities; namespace WorkFlow.Infrastructure.Repositories; +[Obsolete("Use Repository")] public class StateRepository : CRUDRepository, IStateRepository, ICRUDRepository { public StateRepository(WFDBContext dbContext) : base(dbContext, dbContext.States) diff --git a/src/WorkFlow.Infrastructure/WorkFlow.Infrastructure.csproj b/src/WorkFlow.Infrastructure/WorkFlow.Infrastructure.csproj index 615e80e..49b89f6 100644 --- a/src/WorkFlow.Infrastructure/WorkFlow.Infrastructure.csproj +++ b/src/WorkFlow.Infrastructure/WorkFlow.Infrastructure.csproj @@ -7,8 +7,9 @@ - - + + +