refactor(Infrastructure): update Executor, Migrations and Repositories to be compiled only in .NET

This commit is contained in:
2025-10-01 10:36:57 +02:00
parent 167ea1444b
commit 12063f36de
23 changed files with 2344 additions and 2298 deletions

View File

@@ -1,4 +1,5 @@
using Dapper;
#if NET
using Dapper;
using EnvelopeGenerator.Application.Common.Interfaces.SQLExecutor;
using EnvelopeGenerator.Application.Common.SQL;
using EnvelopeGenerator.Domain.Entities;
@@ -27,3 +28,4 @@ public class DocumentExecutor : SQLExecutor, IDocumentExecutor
$"base64={base64}, envelope_uuid='{envelope_uuid}'.");
}
}
#endif

View File

@@ -1,4 +1,5 @@
using Dapper;
#if NET
using Dapper;
using DigitalData.UserManager.Application.Contracts.Repositories;
using EnvelopeGenerator.Application.Common.Interfaces.SQLExecutor;
using EnvelopeGenerator.Application.Common.SQL;
@@ -36,4 +37,5 @@ public class EnvelopeExecutor : SQLExecutor, IEnvelopeExecutor
return envelope;
}
}
}
#endif

View File

@@ -1,4 +1,5 @@
using Dapper;
#if NET
using Dapper;
using EnvelopeGenerator.Application.Common.Interfaces.Repositories;
using EnvelopeGenerator.Application.Common.Interfaces.SQLExecutor;
using EnvelopeGenerator.Application.Common.SQL;
@@ -9,7 +10,7 @@ using Microsoft.Extensions.Options;
namespace EnvelopeGenerator.Infrastructure.Executor;
public class EnvelopeReceiverExecutor: SQLExecutor, IEnvelopeReceiverExecutor
public class EnvelopeReceiverExecutor : SQLExecutor, IEnvelopeReceiverExecutor
{
private readonly IEnvelopeReceiverRepository _erRepository;
@@ -33,3 +34,4 @@ public class EnvelopeReceiverExecutor: SQLExecutor, IEnvelopeReceiverExecutor
return await _erRepository.ReadByIdAsync(envelopeId: er.EnvelopeId, receiverId: er.ReceiverId);
}
}
#endif

View File

@@ -1,4 +1,5 @@
using EnvelopeGenerator.Application.Common.Interfaces.SQLExecutor;
#if NET
using EnvelopeGenerator.Application.Common.Interfaces.SQLExecutor;
using Microsoft.EntityFrameworkCore;
namespace EnvelopeGenerator.Infrastructure.Executor;
@@ -38,4 +39,5 @@ public sealed record Query<TEntity> : IQuery<TEntity>
public async Task<IEnumerable<TEntity>> ToListAsync() => await _query.ToListAsync();
}
}
#endif

View File

@@ -1,4 +1,5 @@
namespace EnvelopeGenerator.Infrastructure.Executor;
#if NET
namespace EnvelopeGenerator.Infrastructure.Executor;
public static class QueryExtension
{
@@ -6,4 +7,5 @@ public static class QueryExtension
{
return new Query<TEntity>(queryable);
}
}
}
#endif

View File

@@ -1,4 +1,5 @@
using Dapper;
#if NET
using Dapper;
using EnvelopeGenerator.Application.Common.Interfaces.SQLExecutor;
using Microsoft.Data.SqlClient;
using Microsoft.Extensions.DependencyInjection;
@@ -30,4 +31,5 @@ public class SQLExecutor : ISQLExecutor
var sql = Provider.GetRequiredService<TSQL>();
return Execute<TEntity>(sql.Raw, parameters, cancellation);
}
}
}
#endif

View File

@@ -1,4 +1,5 @@
using EnvelopeGenerator.Application.Common.Interfaces.SQLExecutor;
#if NET
using EnvelopeGenerator.Application.Common.Interfaces.SQLExecutor;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
@@ -29,3 +30,5 @@ public sealed class SQLExecutor<T> : SQLExecutor, ISQLExecutor<T> where T : clas
return Execute(sql.Raw);
}
}
#endif

View File

@@ -1,6 +1,9 @@
namespace EnvelopeGenerator.Infrastructure.Executor;
#if NET
namespace EnvelopeGenerator.Infrastructure.Executor;
public class SQLExecutorParams
{
public string? ConnectionString { get; set; }
}
#endif