Migration to net 6 - not working for now
This commit is contained in:
@@ -27,7 +27,7 @@ namespace BusinessLogic.LookupLogic
|
||||
public async Task<DataResult<List<LookupCategory>>> GetAllLookups()
|
||||
{
|
||||
var result = await _lookupRepo.GetAllLookups();
|
||||
_logger.LogInformation($"Call to GetAllLookups ended with {nameof(result.GeneralResult)}");
|
||||
_logger.LogInformation($"Call to GetAllLookups ended with {result.GeneralResult.ToString()}");
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,17 +1,13 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration" Version="3.1.16" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="3.1.16" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.0-rc.2.21480.5"/>
|
||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0-rc.2.21480.5"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Datamodels\Datamodels.csproj" />
|
||||
<ProjectReference Include="..\..\Repositories\Repositories.csproj" />
|
||||
<ProjectReference Include="..\..\Datamodels\Datamodels.csproj"/>
|
||||
<ProjectReference Include="..\..\Repositories\Repositories.csproj"/>
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.1</TargetFramework>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,9 @@
|
||||
using System;
|
||||
|
||||
namespace SearchApi.Exceptions
|
||||
{
|
||||
public class FieldAliasMissingException : Exception
|
||||
{
|
||||
public FieldAliasMissingException(string message) : base(message: message) {}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using System;
|
||||
|
||||
namespace SearchApi.Exceptions
|
||||
{
|
||||
public class TableAliasMissingException : Exception
|
||||
{
|
||||
public TableAliasMissingException(string message) : base(message: message) {}
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@ using Datamodels.BusinessModels;
|
||||
using Datamodels.DatabaseModels;
|
||||
using Datamodels.SearchModels;
|
||||
|
||||
namespace SearchLogic
|
||||
namespace SearchApi.SearchLogic
|
||||
{
|
||||
public interface ISearchLogic
|
||||
{
|
||||
|
||||
@@ -9,14 +9,21 @@ using Datamodels.SearchModels;
|
||||
using Newtonsoft.Json;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using SearchApi.Exceptions;
|
||||
|
||||
namespace SearchLogic
|
||||
namespace SearchApi.SearchLogic
|
||||
{
|
||||
public class SearchLogic : ISearchLogic
|
||||
{
|
||||
private readonly ILogger<SearchLogic> _logger;
|
||||
private readonly IFwMariaSearchRepo _searchRepo;
|
||||
|
||||
private List<string> _tableNames;
|
||||
private List<string> _joinConditions;
|
||||
private List<string> _fieldNames;
|
||||
private List<string> _whereConditions;
|
||||
private List<string> _sortFields;
|
||||
|
||||
public SearchLogic(ILogger<SearchLogic> logger, IFwMariaSearchRepo searchRepo)
|
||||
{
|
||||
_logger = logger;
|
||||
@@ -37,5 +44,61 @@ namespace SearchLogic
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// Extract Table
|
||||
private void GetTables(FilterModel filter)
|
||||
{
|
||||
bool hasTableList = filter.TableDescriptions.Count > 0;
|
||||
_tableNames = new List<string>();
|
||||
foreach(var table in filter.TableDescriptions)
|
||||
{
|
||||
if (hasTableList && string.IsNullOrEmpty(table.TableAlias))
|
||||
{
|
||||
throw new TableAliasMissingException($"No Alias defined for Table {table.TableName}");
|
||||
}
|
||||
_tableNames.Add($"{table.TableName} {(string.IsNullOrEmpty(table.TableAlias) ? string.Empty : table.TableAlias)}");
|
||||
}
|
||||
}
|
||||
|
||||
// Extract Fieldlist
|
||||
private void GetFields(FilterModel filter)
|
||||
{
|
||||
var tables = filter.TableDescriptions;
|
||||
foreach (var table in tables)
|
||||
{
|
||||
bool hasMultipleFields = table.Fields.Count > 0;
|
||||
foreach (var field in table.Fields) {
|
||||
if (hasMultipleFields && string.IsNullOrEmpty(field.FieldAlias))
|
||||
{
|
||||
throw new FieldAliasMissingException($"No Alias defined for Field {field.FieldName} in Table {table.TableName}");
|
||||
}
|
||||
_fieldNames.Add($"{table.TableAlias}.{field.FieldName} {field.FieldAlias}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Extract Join Path if more than one table
|
||||
private void GetTableJoinConditions(FilterModel filter)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Extract Where Conditions
|
||||
private void GetWhereConditions(FilterModel filter)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Extract Sort Items
|
||||
private void GetSortFields(FilterModel filter)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Assemble SQL Query
|
||||
private string AssembleSqlQuery()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.1</TargetFramework>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,22 +1,18 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Datamodels\Datamodels.csproj" />
|
||||
<ProjectReference Include="..\Datamodels\Datamodels.csproj"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.16" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.16">
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.0-rc.2.21480.5"/>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.0-rc.2.21480.5">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="3.2.6" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration" Version="3.1.16" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="3.1.16" />
|
||||
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="6.0.0-preview.7"/>
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.0-rc.2.21480.5"/>
|
||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0-rc.2.21480.5"/>
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.1</TargetFramework>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
@@ -2,7 +2,7 @@ using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System.Threading.Tasks;
|
||||
using SearchLogic;
|
||||
using SearchApi.SearchLogic;
|
||||
using Datamodels.SearchModels;
|
||||
using System.Collections.Generic;
|
||||
using Datamodels.DatabaseModels;
|
||||
|
||||
@@ -1,41 +1,36 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<LangVersion>10</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Elastic.Apm.EntityFrameworkCore" Version="1.11.1" />
|
||||
<PackageReference Include="Elastic.Apm.NetCoreAll" Version="1.11.1" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.16" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
<PackageReference Include="OpenTelemetry.Contrib.Instrumentation.EntityFrameworkCore" Version="1.0.0-beta2" />
|
||||
<PackageReference Include="OpenTelemetry.Exporter.Console" Version="1.1.0" />
|
||||
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.1.0" />
|
||||
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.0.0-rc7" />
|
||||
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.0.0-rc7" />
|
||||
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.0.0-rc7" />
|
||||
<PackageReference Include="Serilog.AspNetCore" Version="4.1.0" />
|
||||
<PackageReference Include="Serilog.Enrichers.Environment" Version="2.2.0" />
|
||||
<PackageReference Include="Serilog.Enrichers.ExceptionStackTraceHash" Version="1.3.0" />
|
||||
<PackageReference Include="Serilog.Exceptions" Version="7.1.0" />
|
||||
<PackageReference Include="Serilog.Formatting.Elasticsearch" Version="8.4.1" />
|
||||
<PackageReference Include="Serilog.Settings.Configuration" Version="3.3.0" />
|
||||
<PackageReference Include="serilog.sinks.console" Version="4.0.0" />
|
||||
<PackageReference Include="Serilog.Sinks.ElasticSearch" Version="8.4.1" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.2" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore.Swagger" Version="6.2.2" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="6.2.2" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="6.2.2" />
|
||||
<PackageReference Include="Elastic.Apm.EntityFrameworkCore" Version="1.11.1"/>
|
||||
<PackageReference Include="Elastic.Apm.NetCoreAll" Version="1.11.1"/>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.0-rc.2.21480.10"/>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1"/>
|
||||
<PackageReference Include="OpenTelemetry.Contrib.Instrumentation.EntityFrameworkCore" Version="1.0.0-beta2"/>
|
||||
<PackageReference Include="OpenTelemetry.Exporter.Console" Version="1.1.0"/>
|
||||
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.1.0"/>
|
||||
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.0.0-rc7"/>
|
||||
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.0.0-rc7"/>
|
||||
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.0.0-rc7"/>
|
||||
<PackageReference Include="Serilog.AspNetCore" Version="4.1.0"/>
|
||||
<PackageReference Include="Serilog.Enrichers.Environment" Version="2.2.0"/>
|
||||
<PackageReference Include="Serilog.Enrichers.ExceptionStackTraceHash" Version="1.3.0"/>
|
||||
<PackageReference Include="Serilog.Exceptions" Version="7.1.0"/>
|
||||
<PackageReference Include="Serilog.Formatting.Elasticsearch" Version="8.4.1"/>
|
||||
<PackageReference Include="Serilog.Settings.Configuration" Version="3.3.0"/>
|
||||
<PackageReference Include="serilog.sinks.console" Version="4.0.0"/>
|
||||
<PackageReference Include="Serilog.Sinks.ElasticSearch" Version="8.4.1"/>
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.2"/>
|
||||
<PackageReference Include="Swashbuckle.AspNetCore.Swagger" Version="6.2.2"/>
|
||||
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="6.2.2"/>
|
||||
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="6.2.2"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\BusinessLogic\LookupLogic\LookupLogic.csproj" />
|
||||
<ProjectReference Include="..\BusinessLogic\SearchLogic\SearchLogic.csproj" />
|
||||
<ProjectReference Include="..\Datamodels\Datamodels.csproj" />
|
||||
<ProjectReference Include="..\Repositories\Repositories.csproj" />
|
||||
<ProjectReference Include="..\BusinessLogic\LookupLogic\LookupLogic.csproj"/>
|
||||
<ProjectReference Include="..\BusinessLogic\SearchLogic\SearchLogic.csproj"/>
|
||||
<ProjectReference Include="..\Datamodels\Datamodels.csproj"/>
|
||||
<ProjectReference Include="..\Repositories\Repositories.csproj"/>
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
</Project>
|
||||
@@ -16,7 +16,7 @@ using OpenTelemetry.Trace;
|
||||
using Repositories;
|
||||
using Repositories.Interfaces;
|
||||
|
||||
using SearchLogic;
|
||||
using SearchApi.SearchLogic;
|
||||
|
||||
namespace FwSearchApi
|
||||
{
|
||||
@@ -43,7 +43,7 @@ namespace FwSearchApi
|
||||
services.AddTransient<ILookupLogic, FwLookupLogic>();
|
||||
services.AddTransient<IFwMariaLookupRepo, FwMariaLookupRepo>();
|
||||
services.AddTransient<IFwMariaSearchRepo, FwMariaSearchRepo>();
|
||||
services.AddTransient<ISearchLogic, SearchLogic.SearchLogic>();
|
||||
services.AddTransient<ISearchLogic, SearchLogic>();
|
||||
services.AddSwaggerGen();
|
||||
AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true); //needed if no Security is used when calling APM Server
|
||||
services.AddOpenTelemetryTracing((builder) => builder
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -1,19 +1,15 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\Repositories\Repositories.csproj" />
|
||||
<ProjectReference Include="..\..\..\Repositories\Repositories.csproj"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.1.16">
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.0-rc.2.21480.5">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
Reference in New Issue
Block a user