Compare commits

...

18 Commits

Author SHA1 Message Date
dd9c1c7ca2 Change default addedWho param to null in ToObjectProcedure
Updated ToObjectProcedure methods in Insert*Procedure records to use null as the default value for the addedWho parameter instead of "Rec.API". This affects InsertActionProcedure, InsertEndpointAuthProcedure, InsertEndpointParamsProcedure, InsertEndpointProcedure, and InsertProfileProcedure.
2026-01-14 17:14:17 +01:00
f9cc735318 Update AddedBy to default to "ReC.API" if no value provided
The AddedBy method in InsertObjectProcedure now accepts an optional parameter and sets AddedWho to "ReC.API" when no argument is supplied, ensuring a consistent default value.
2026-01-14 17:12:15 +01:00
2a8eb3c0ad Mark legacy DbSets as obsolete in IRecDbContext
Several entity-based DbSet properties in IRecDbContext are now marked with [Obsolete("Use Views instead.")], guiding developers to use view-based DbSets. The Profiles DbSet is now explicitly typed as Domain.Entities.Profile. No functional code was removed.
2026-01-14 17:10:55 +01:00
7a4cdb3d1f Support querying multiple profile views in ReadProfileView
Refactored ReadProfileViewQuery and handler to return multiple profiles as IEnumerable<ProfileViewDto>. Made Id parameter optional to allow fetching all profiles. Updated exception handling for empty results.
2026-01-14 16:30:41 +01:00
453b6d1813 Add ProfileController with MediatR GET endpoint
Introduced ProfileController to the API, implementing a GET endpoint that uses MediatR to handle ReadProfileViewQuery requests and return profile data. This supports CQRS and structured profile retrieval.
2026-01-14 16:23:00 +01:00
bd2b5ff62f Add ReadProfileViewQuery and handler for profile views
Introduce CQRS/MediatR query and handler to fetch ProfileView by Id,
optionally including related Actions. Uses repository and AutoMapper,
throws NotFoundException if profile is missing, and returns ProfileViewDto.
2026-01-14 16:12:54 +01:00
849de7a204 Replace CreateResultViewCommand with InsertResultProcedure
Updated ResultViewController to use InsertResultProcedure instead of CreateResultViewCommand. Changed import statements, method parameters, and response construction to reflect the new procedure type.
2026-01-14 15:31:16 +01:00
c7423fb6fd Refactor RecAction creation and remove fake endpoint
Refactored the CreateAction endpoint to use InsertActionProcedure and mediator.ExecuteInsertProcedure, replacing the obsolete CreateRecActionCommand. Removed the deprecated CreateFakeAction endpoint and all related code from RecActionController.
2026-01-14 15:25:40 +01:00
ad51e4b1eb Update OutResController to use ReadResultViewQuery
Switched GET endpoints to ReadResultViewQuery for modernized query handling. Removed [Obsolete] from the controller class, but added it to DELETE endpoints to mark them as deprecated. Updated "fake" profile GET endpoints to use the new query model and removed obsolete warnings from these methods.
2026-01-14 15:10:20 +01:00
df2ebe0cc2 Refactor to use ExecuteInsertProcedure for result insert
Replaced sender.Send and ToObjectProcedure with sender.ExecuteInsertProcedure, passing the InsertResultProcedure object, AddedWho config, and cancellation token directly. This simplifies and clarifies the result insertion process.
2026-01-14 15:00:22 +01:00
5c06f287ab Refactor insert procedure API and add extension method
Changed IInsertProcedure.ToObjectProcedure to accept an optional addedWho parameter. Introduced InsertObjectProcedureExtensions with an ExecuteInsertProcedure extension for ISender, defaulting addedWho to "Rec.API" if not specified.
2026-01-14 14:56:10 +01:00
c3e3a0377d Switch to InsertResultProcedure for result handling
Replaced CreateOutResCommand with InsertResultProcedure when sending results. Updated property names (StatusId instead of Status) and now use ToObjectProcedure to include AddedWho. Added InsertProcedure namespace import.
2026-01-14 14:40:30 +01:00
cf34a54170 Mark CreateResultViewCommand as obsolete, add handler
CreateResultViewCommand is now marked obsolete, advising use of related procedures or views instead. Added an obsolete CreateResultViewCommandHandler that delegates creation to the repository.
2026-01-14 14:36:30 +01:00
16f48f125b Refactor ToObjectProcedure default parameter handling
Changed ToObjectProcedure to use a nullable addedWho parameter and set "Rec.API" as a fallback within the method, ensuring consistent default behavior.
2026-01-14 14:32:17 +01:00
e3faa2f570 Mark entity classes as obsolete; add table attributes
Marked Connection, Endpoint, EndpointAuth, EndpointParam, OutRes, Profile, and RecAction classes as obsolete with [Obsolete("Use Views instead.")]. Added or updated [Table] attributes to specify database tables and schemas for each class. This signals a transition to using Views instead of these entities.
2026-01-14 13:41:52 +01:00
0d30b5ff87 Register default repository for TRecDbContext
Also register the default repository for TRecDbContext in dependency injection, ensuring both custom and default repositories are available for use.
2026-01-14 13:32:09 +01:00
563375f6e3 Refactor validator to use nested property accessors
Update InsertObjectProcedureValidator to reference nested properties (e.g., x.Action.ProfileId instead of x.ActionProfileId) throughout all entity validation rules. Adjust .When conditions accordingly to match the new data model structure with grouped sub-objects.
2026-01-14 13:17:10 +01:00
3864b0f68b Add CommonController with POST endpoint using MediatR
Introduced CommonController in the ReC.API.Controllers namespace with a POST endpoint at "api/common". The endpoint accepts an InsertObjectProcedure from the request body, sends it via MediatR, and returns a 201 Created response with the generated ID.
2026-01-14 13:13:23 +01:00
26 changed files with 142 additions and 87 deletions

View File

@@ -0,0 +1,17 @@
using MediatR;
using Microsoft.AspNetCore.Mvc;
using ReC.Application.Common.Procedures.InsertProcedure;
namespace ReC.API.Controllers;
[Route("api/[controller]")]
[ApiController]
public class CommonController(IMediator mediator) : ControllerBase
{
[HttpPost]
public async Task<IActionResult> CreateObject([FromBody] InsertObjectProcedure procedure, CancellationToken cancel)
{
var id = await mediator.Send(procedure, cancel);
return StatusCode(StatusCodes.Status201Created, id);
}
}

View File

@@ -7,7 +7,6 @@ using ReC.Application.OutResults.Queries;
namespace ReC.API.Controllers;
[Obsolete("This controller is deprecated and will be removed in future versions. Use the new ResultViewController instead.")]
[Route("api/[controller]")]
[ApiController]
public class OutResController(IMediator mediator, IConfiguration config) : ControllerBase
@@ -20,7 +19,7 @@ public class OutResController(IMediator mediator, IConfiguration config) : Contr
/// <returns>A list of output results matching the query.</returns>
[HttpGet]
[ProducesResponseType(StatusCodes.Status200OK)]
public async Task<IActionResult> Get([FromQuery] ReadOutResQuery query, CancellationToken cancel) => Ok(await mediator.Send(query, cancel));
public async Task<IActionResult> Get([FromQuery] ReadResultViewQuery query, CancellationToken cancel) => Ok(await mediator.Send(query, cancel));
/// <summary>
/// Gets output results for a fake/test profile.
@@ -29,8 +28,7 @@ public class OutResController(IMediator mediator, IConfiguration config) : Contr
/// <returns>A list of output results for the fake profile.</returns>
[HttpGet("fake")]
[ProducesResponseType(StatusCodes.Status200OK)]
[Obsolete("Use the related procedure or view.")]
public async Task<IActionResult> Get(CancellationToken cancel) => Ok(await mediator.Send(new ReadOutResQuery()
public async Task<IActionResult> Get(CancellationToken cancel) => Ok(await mediator.Send(new ReadResultViewQuery()
{
ProfileId = config.GetFakeProfileId()
}, cancel));
@@ -44,10 +42,9 @@ public class OutResController(IMediator mediator, IConfiguration config) : Contr
/// <returns>The requested output result or a part of it (header/body).</returns>
[HttpGet("fake/{actionId}")]
[ProducesResponseType(StatusCodes.Status200OK)]
[Obsolete("Use the related procedure or view.")]
public async Task<IActionResult> Get([FromRoute] long actionId, CancellationToken cancel, ResultType resultType = ResultType.Full)
{
var res = (await mediator.Send(new ReadOutResQuery()
var res = (await mediator.Send(new ReadResultViewQuery()
{
ProfileId = config.GetFakeProfileId(),
ActionId = actionId
@@ -69,6 +66,7 @@ public class OutResController(IMediator mediator, IConfiguration config) : Contr
/// <returns>An empty response indicating success.</returns>
[HttpDelete]
[ProducesResponseType(StatusCodes.Status204NoContent)]
[Obsolete("Use the related procedure or view.")]
public async Task<IActionResult> Delete([FromQuery] DeleteOutResCommand command, CancellationToken cancel)
{
await mediator.Send(command, cancel);
@@ -83,6 +81,7 @@ public class OutResController(IMediator mediator, IConfiguration config) : Contr
[HttpDelete("fake")]
[ProducesResponseType(StatusCodes.Status204NoContent)]
[ProducesResponseType(StatusCodes.Status400BadRequest)]
[Obsolete("Use the related procedure or view.")]
public async Task<IActionResult> Delete(CancellationToken cancel)
{
await mediator.Send(new DeleteOutResCommand() { ProfileId = config.GetFakeProfileId() }, cancel);

View File

@@ -0,0 +1,16 @@
using MediatR;
using Microsoft.AspNetCore.Mvc;
using ReC.Application.Profile.Queries;
namespace ReC.API.Controllers;
[Route("api/[controller]")]
[ApiController]
public class ProfileController(IMediator mediator) : ControllerBase
{
[HttpGet]
public async Task<IActionResult> GetProfile([FromQuery] ReadProfileViewQuery query, CancellationToken cancel)
{
return Ok(await mediator.Send(query, cancel));
}
}

View File

@@ -1,10 +1,9 @@
using MediatR;
using Microsoft.AspNetCore.Mvc;
using ReC.API.Extensions;
using ReC.API.Models;
using ReC.Application.Common.Procedures.InsertProcedure;
using ReC.Application.RecActions.Commands;
using ReC.Application.RecActions.Queries;
using System.Text.Json;
namespace ReC.API.Controllers;
@@ -72,51 +71,11 @@ public class RecActionController(IMediator mediator, IConfiguration config) : Co
/// <returns>An HTTP 201 Created response.</returns>
[HttpPost]
[ProducesResponseType(StatusCodes.Status201Created)]
[Obsolete("Use the related procedure.")]
public async Task<IActionResult> CreateAction([FromBody] CreateRecActionCommand command, CancellationToken cancel)
public async Task<IActionResult> CreateAction([FromBody] InsertActionProcedure command, CancellationToken cancel)
{
await mediator.Send(command, cancel);
await mediator.ExecuteInsertProcedure(command, config["AddedWho"], cancel);
return CreatedAtAction(nameof(CreateAction), null);
}
/// <summary>
/// Creates a new fake RecAction for testing purposes.
/// </summary>
/// <param name="cancel">A token to cancel the operation.</param>
/// <param name="request">The optional request body and header for the fake action.</param>
/// <param name="endpointUri">The target endpoint URI.</param>
/// <param name="endpointPath">The optional path to append to the endpoint URI.</param>
/// <param name="type">The HTTP method type (e.g., GET, POST).</param>
/// <returns>An HTTP 201 Created response.</returns>
[HttpPost("fake")]
[ProducesResponseType(StatusCodes.Status201Created)]
[Obsolete("Use the related procedure.")]
public async Task<IActionResult> CreateFakeAction(
CancellationToken cancel,
[FromBody] FakeRequest? request = null,
[FromQuery] string endpointUri = "https://jsonplaceholder.typicode.com/posts",
[FromQuery] string? endpointPath = "1",
[FromQuery] string type = "GET")
{
if (endpointPath is not null)
endpointUri = new Uri(new Uri(endpointUri.TrimEnd('/') + "/"), endpointPath.TrimStart('/')).ToString();
var bodyJson = request?.Body is not null ? JsonSerializer.Serialize(request.Body, options: new() { WriteIndented = false }) : null;
var headerJson = request?.Header is not null ? JsonSerializer.Serialize(request.Header, options: new() { WriteIndented = false }) : null;
await mediator.Send(new CreateRecActionCommand()
{
ProfileId = config.GetFakeProfileId(),
EndpointUri = endpointUri,
Type = type,
BodyQuery = $@"SELECT '{bodyJson ?? "NULL"}' AS REQUEST_BODY;",
HeaderQuery = headerJson is not null ? $@"SELECT '{headerJson}' AS REQUEST_HEADER;" : null,
Active = true,
EndpointAuthId = 4
}, cancel);
return CreatedAtAction(nameof(CreateFakeAction), null);
return StatusCode(StatusCodes.Status201Created);
}
/// <summary>

View File

@@ -2,7 +2,7 @@
using Microsoft.AspNetCore.Mvc;
using ReC.API.Extensions;
using ReC.API.Models;
using ReC.Application.OutResults.Commands;
using ReC.Application.Common.Procedures.InsertProcedure;
using ReC.Application.OutResults.Queries;
namespace ReC.API.Controllers;
@@ -41,9 +41,9 @@ public class ResultViewController(IMediator mediator, IConfiguration config) : C
}
[HttpPost]
public async Task<IActionResult> Create([FromBody] CreateResultViewCommand command, CancellationToken cancel)
public async Task<IActionResult> Create([FromBody] InsertResultProcedure procedure, CancellationToken cancel)
{
await mediator.Send(command, cancel);
return CreatedAtAction(nameof(Get), new { actionId = command.ActionId }, command);
await mediator.Send(procedure, cancel);
return CreatedAtAction(nameof(Get), new { actionId = procedure.ActionId }, procedure);
}
}

View File

@@ -8,6 +8,7 @@ namespace ReC.Application.Common.Interfaces;
public interface IRecDbContext
{
#region DbSets
[Obsolete("Use Views instead.")]
public DbSet<EndpointParam> EndpointParams { get; set; }
public DbSet<RecActionView> RecActionViews { get; set; }
@@ -16,20 +17,26 @@ public interface IRecDbContext
public DbSet<ResultView> RecResultViews { get; set; }
[Obsolete("Use Views instead.")]
public DbSet<OutRes> OutRes { get; set; }
public DbSet<HeaderQueryResult> HeaderQueryResults { get; set; }
public DbSet<BodyQueryResult> BodyQueryResults { get; set; }
[Obsolete("Use Views instead.")]
public DbSet<Connection> Connections { get; set; }
[Obsolete("Use Views instead.")]
public DbSet<Endpoint> Endpoints { get; set; }
[Obsolete("Use Views instead.")]
public DbSet<EndpointAuth> EndpointAuths { get; set; }
public DbSet<Profile> Profiles { get; set; }
[Obsolete("Use Views instead.")]
public DbSet<Domain.Entities.Profile> Profiles { get; set; }
[Obsolete("Use Views instead.")]
public DbSet<RecAction> RecActions { get; set; }
public DbSet<InsertObjectResult> RecResults { get; set; }

View File

@@ -2,5 +2,5 @@
public interface IInsertProcedure
{
public InsertObjectProcedure ToObjectProcedure(string addedWho = "Rec.API");
public InsertObjectProcedure ToObjectProcedure(string? addedWho = null);
}

View File

@@ -16,7 +16,7 @@ public record InsertActionProcedure : IInsertProcedure
public string? PostSql { get; set; }
public byte? ErrorActionId { get; set; }
public InsertObjectProcedure ToObjectProcedure(string addedWho = "Rec.API")
public InsertObjectProcedure ToObjectProcedure(string? addedWho = null)
{
return new InsertObjectProcedure
{

View File

@@ -14,7 +14,7 @@ public record InsertEndpointAuthProcedure : IInsertProcedure
public string? Domain { get; set; }
public string? Workstation { get; set; }
public InsertObjectProcedure ToObjectProcedure(string addedWho = "Rec.API")
public InsertObjectProcedure ToObjectProcedure(string? addedWho = null)
{
return new InsertObjectProcedure
{

View File

@@ -9,7 +9,7 @@ public record InsertEndpointParamsProcedure : IInsertProcedure
public string? Key { get; set; }
public string? Value { get; set; }
public InsertObjectProcedure ToObjectProcedure(string addedWho = "Rec.API")
public InsertObjectProcedure ToObjectProcedure(string? addedWho = null)
{
return new InsertObjectProcedure
{

View File

@@ -6,7 +6,7 @@ public record InsertEndpointProcedure : IInsertProcedure
public string? Description { get; set; }
public string? Uri { get; set; }
public InsertObjectProcedure ToObjectProcedure(string addedWho = "Rec.API")
public InsertObjectProcedure ToObjectProcedure(string? addedWho = null)
{
return new InsertObjectProcedure
{

View File

@@ -14,9 +14,9 @@ public record InsertObjectProcedure : IRequest<long>
internal string? AddedWho { get; private set; }
public InsertObjectProcedure AddedBy(string addedWho)
public InsertObjectProcedure AddedBy(string? addedWho = null)
{
AddedWho = addedWho;
AddedWho = addedWho ?? "ReC.API";
return this;
}
@@ -28,6 +28,14 @@ public record InsertObjectProcedure : IRequest<long>
public InsertEndpointParamsProcedure EndpointParams { get; set; } = new();
}
public static class InsertObjectProcedureExtensions
{
public static Task<long> ExecuteInsertProcedure(this ISender sender, IInsertProcedure procedure, string? addedWho = null, CancellationToken cancel = default)
{
return sender.Send(procedure.ToObjectProcedure(addedWho ?? "Rec.API"), cancel);
}
}
public class InsertObjectProcedureHandler(IRepository repo) : IRequestHandler<InsertObjectProcedure, long>
{
public async Task<long> Handle(InsertObjectProcedure request, CancellationToken cancel)

View File

@@ -10,7 +10,7 @@ public record InsertProfileProcedure : IInsertProcedure
public byte? LogLevelId { get; set; }
public short? LanguageId { get; set; }
public InsertObjectProcedure ToObjectProcedure(string addedWho = "Rec.API")
public InsertObjectProcedure ToObjectProcedure(string? addedWho = null)
{
return new InsertObjectProcedure
{

View File

@@ -7,12 +7,12 @@ public record InsertResultProcedure : IInsertProcedure
public string? Header { get; set; }
public string? Body { get; set; }
public InsertObjectProcedure ToObjectProcedure(string addedWho = "Rec.API")
public InsertObjectProcedure ToObjectProcedure(string? addedWho = null)
{
return new InsertObjectProcedure
{
Entity = "RESULT",
Result = this
}.AddedBy(addedWho);
}.AddedBy(addedWho ?? "Rec.API");
}
}

View File

@@ -16,11 +16,11 @@ public class InsertObjectProcedureValidator : AbstractValidator<InsertObjectProc
// ACTION validation
When(x => x.Entity == "ACTION", () =>
{
RuleFor(x => x.ActionProfileId)
RuleFor(x => x.Action.ProfileId)
.NotNull()
.WithMessage("ACTION requires ActionProfileId (maps to @pACTION_PROFILE_ID).");
RuleFor(x => x.ActionEndpointId)
RuleFor(x => x.Action.EndpointId)
.NotNull()
.WithMessage("ACTION requires ActionEndpointId (maps to @pACTION_ENDPOINT_ID).");
});
@@ -28,7 +28,7 @@ public class InsertObjectProcedureValidator : AbstractValidator<InsertObjectProc
// ENDPOINT validation
When(x => x.Entity == "ENDPOINT", () =>
{
RuleFor(x => x.EndpointUri)
RuleFor(x => x.Endpoint.Uri)
.NotEmpty()
.WithMessage("ENDPOINT requires EndpointUri (maps to @pENDPOINT_URI).")
.MaximumLength(2000);
@@ -37,28 +37,28 @@ public class InsertObjectProcedureValidator : AbstractValidator<InsertObjectProc
// PROFILE validation
When(x => x.Entity == "PROFILE", () =>
{
RuleFor(x => x.ProfileName)
RuleFor(x => x.Profile.Name)
.NotEmpty()
.WithMessage("PROFILE requires ProfileName (maps to @pPROFILE_NAME).")
.MaximumLength(50);
RuleFor(x => x.ProfileMandantor)
RuleFor(x => x.Profile.Mandantor)
.MaximumLength(50)
.When(x => x.ProfileMandantor != null);
.When(x => x.Profile.Mandantor != null);
RuleFor(x => x.ProfileDescription)
RuleFor(x => x.Profile.Description)
.MaximumLength(250)
.When(x => x.ProfileDescription != null);
.When(x => x.Profile.Description != null);
});
// RESULT validation
When(x => x.Entity == "RESULT", () =>
{
RuleFor(x => x.ResultActionId)
RuleFor(x => x.Result.ActionId)
.NotNull()
.WithMessage("RESULT requires ResultActionId (maps to @pRESULT_ACTION_ID).");
RuleFor(x => x.ResultStatusId)
RuleFor(x => x.Result.StatusId)
.NotNull()
.WithMessage("RESULT requires ResultStatusId (maps to @pRESULT_STATUS_ID).");
});
@@ -66,7 +66,7 @@ public class InsertObjectProcedureValidator : AbstractValidator<InsertObjectProc
// ENDPOINT_PARAMS validation
When(x => x.Entity == "ENDPOINT_PARAMS", () =>
{
RuleFor(x => x.EndpointParamsGroupId)
RuleFor(x => x.EndpointParams.GroupId)
.NotNull()
.WithMessage("ENDPOINT_PARAMS requires EndpointParamsGroupId (maps to @pENDPOINT_PARAMS_GROUP_ID).");
});
@@ -76,12 +76,12 @@ public class InsertObjectProcedureValidator : AbstractValidator<InsertObjectProc
.MaximumLength(50)
.When(x => x.AddedWho != null);
RuleFor(x => x.EndpointDescription)
RuleFor(x => x.Endpoint.Description)
.MaximumLength(250)
.When(x => x.EndpointDescription != null);
.When(x => x.Endpoint.Description != null);
RuleFor(x => x.EndpointAuthDescription)
RuleFor(x => x.EndpointAuth.Description)
.MaximumLength(250)
.When(x => x.EndpointAuthDescription != null);
.When(x => x.EndpointAuth.Description != null);
}
}

View File

@@ -6,6 +6,7 @@ using System.Text.Json.Serialization;
namespace ReC.Application.OutResults.Commands;
[Obsolete("Use the related procedure or view.")]
public class CreateResultViewCommand : IAuthScoped, IRequest
{
public required long ActionId { get; set; }
@@ -20,6 +21,7 @@ public class CreateResultViewCommand : IAuthScoped, IRequest
public AuthScope Scope { get; } = new();
}
[Obsolete("Use the related procedure or view.")]
public class CreateResultViewCommandHandler(IRepository<ResultView> repo) : IRequestHandler<CreateResultViewCommand>
{
public Task Handle(CreateResultViewCommand request, CancellationToken cancel) => repo.CreateAsync(request, cancel);

View File

@@ -0,0 +1,36 @@
using AutoMapper;
using DigitalData.Core.Abstraction.Application.Repository;
using DigitalData.Core.Exceptions;
using MediatR;
using Microsoft.EntityFrameworkCore;
using ReC.Application.Common.Dto;
using ReC.Domain.Views;
namespace ReC.Application.Profile.Queries;
public record ReadProfileViewQuery : IRequest<IEnumerable<ProfileViewDto>>
{
public long? Id { get; init; } = null;
public bool IncludeActions { get; init; } = true;
}
public class ReadProfileViewQueryHandler(IRepository<ProfileView> repo, IMapper mapper)
: IRequestHandler<ReadProfileViewQuery, IEnumerable<ProfileViewDto>>
{
public async Task<IEnumerable<ProfileViewDto>> Handle(ReadProfileViewQuery request, CancellationToken cancel)
{
var query = request.IncludeActions
? repo.Query.Include(p => p.Actions)
: repo.Query;
if (request.Id is long id)
query = query.Where(p => p.Id == id);
var profiles = await query.ToListAsync(cancel);
return profiles is null || profiles.Count == 0
? throw new NotFoundException($"Profile {request.Id} not found.")
: mapper.Map<IEnumerable<ProfileViewDto>>(profiles);
}
}

View File

@@ -4,6 +4,7 @@ using ReC.Application.Common;
using ReC.Application.Common.Constants;
using ReC.Application.Common.Dto;
using ReC.Application.Common.Exceptions;
using ReC.Application.Common.Procedures.InsertProcedure;
using ReC.Application.OutResults.Commands;
using ReC.Domain.Constants;
using System.Net;
@@ -133,14 +134,13 @@ public class InvokeRecActionViewCommandHandler(
var statusCode = (short)response.StatusCode;
await sender.Send(new CreateOutResCommand
await sender.ExecuteInsertProcedure(new InsertResultProcedure()
{
Status = statusCode,
StatusId = statusCode,
ActionId = action.Id,
Header = JsonSerializer.Serialize(resHeaders, options: new() { WriteIndented = false }),
Body = resBody,
AddedWho = config?["AddedWho"]
}, cancel);
Body = resBody
}, config?["AddedWho"], cancel);
return response.IsSuccessStatusCode;
}

View File

@@ -2,6 +2,7 @@
namespace ReC.Domain.Entities;
[Obsolete("Use Views instead.")]
[Table("TBDD_CONNECTION")]
public class Connection
{

View File

@@ -2,6 +2,7 @@
namespace ReC.Domain.Entities;
[Obsolete("Use Views instead.")]
[Table("TBREC_CFG_ENDPOINT")]
public class Endpoint
{

View File

@@ -3,6 +3,7 @@ using System.ComponentModel.DataAnnotations.Schema;
namespace ReC.Domain.Entities;
[Obsolete("Use Views instead.")]
[Table("TBREC_CFG_ENDPOINT_AUTH")]
public class EndpointAuth
{

View File

@@ -7,6 +7,7 @@ namespace ReC.Domain.Entities;
/// All properties are nullable to provide flexibility on the database side,
/// preventing breaking changes if columns are altered to be nullable in production.
/// </summary>
[Obsolete("Use Views instead.")]
[Table("TBREC_CFG_ENDPOINT_PARAMS", Schema = "dbo")]
public class EndpointParam
{

View File

@@ -2,6 +2,7 @@
namespace ReC.Domain.Entities;
[Obsolete("Use Views instead.")]
[Table("TBREC_OUT_RESULT", Schema = "dbo")]
public class OutRes
{

View File

@@ -2,6 +2,7 @@
namespace ReC.Domain.Entities;
[Obsolete("Use Views instead.")]
[Table("TBREC_CFG_PROFILE", Schema = "dbo")]
public class Profile
{

View File

@@ -3,6 +3,7 @@ using System.ComponentModel.DataAnnotations.Schema;
namespace ReC.Domain.Entities;
[Obsolete("Use Views instead.")]
[Table("TBREC_CFG_ACTION")]
public class RecAction
{

View File

@@ -23,7 +23,11 @@ public static class DependencyInjection
services.AddScoped<IRecDbContext>(provider => provider.GetRequiredService<TRecDbContext>());
services.AddDbRepository(opt => opt.RegisterFromAssembly<TRecDbContext>(typeof(RecActionView).Assembly));
services.AddDbRepository(opt =>
{
opt.RegisterFromAssembly<TRecDbContext>(typeof(RecActionView).Assembly);
opt.RegisterDefaultRepository<TRecDbContext>();
});
services.AddValidatorsFromAssembly(typeof(AuthScopedValidator).Assembly);