Skip to content

Commit

Permalink
ModelMetadata + GlobalUsings + ImplicitUsings
Browse files Browse the repository at this point in the history
  • Loading branch information
hakenr committed Mar 29, 2022
1 parent 66cf6f8 commit 1ad74aa
Show file tree
Hide file tree
Showing 52 changed files with 112 additions and 114 deletions.
1 change: 1 addition & 0 deletions Contracts/Contracts.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<AssemblyName>Havit.Bonusario.Contracts</AssemblyName>
<RootNamespace>Havit.Bonusario.Contracts</RootNamespace>
</PropertyGroup>
Expand Down
9 changes: 1 addition & 8 deletions Contracts/GlobalUsings.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1 @@
global using System;
global using System.Collections.Generic;
global using System.Linq;
global using System.Text;
global using System.Threading;
global using System.Threading.Tasks;

global using Havit.Diagnostics.Contracts;
global using Havit.Diagnostics.Contracts;
12 changes: 12 additions & 0 deletions Contracts/Infrastructure/IDataSeedFacade.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using Havit.ComponentModel;

namespace Havit.Bonusario.Contracts.Infrastructure
{
[ApiContract]
public interface IDataSeedFacade
{
Task SeedDataProfile(string profileName);

Task<Dto<string[]>> GetDataSeedProfiles();
}
}
10 changes: 10 additions & 0 deletions Contracts/Infrastructure/IMaintenanceFacade.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using Havit.ComponentModel;

namespace Havit.Bonusario.Contracts.Infrastructure
{
[ApiContract]
public interface IMaintenanceFacade
{
Task ClearCache(CancellationToken cancellationToken = default);
}
}
15 changes: 0 additions & 15 deletions Contracts/System/IDataSeedFacade.cs

This file was deleted.

13 changes: 0 additions & 13 deletions Contracts/System/IMaintenanceFacade.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
using System.Text;
using System.Threading.Tasks;

namespace Havit.Bonusario.Model.Metadata.Common
namespace Havit.Bonusario.Contracts.ModelMetadata.Common
{
[System.CodeDom.Compiler.GeneratedCode("Havit.Data.EntityFrameworkCore.CodeGenerator", "1.0")]
public static class ApplicationSettingsMetadata
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
using System.Text;
using System.Threading.Tasks;

namespace Havit.Bonusario.Model.Metadata
namespace Havit.Bonusario.Contracts.ModelMetadata
{
[System.CodeDom.Compiler.GeneratedCode("Havit.Data.EntityFrameworkCore.CodeGenerator", "1.0")]
public static class EmployeeMetadata
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
using System.Text;
using System.Threading.Tasks;

namespace Havit.Bonusario.Model.Metadata
namespace Havit.Bonusario.Contracts.ModelMetadata
{
[System.CodeDom.Compiler.GeneratedCode("Havit.Data.EntityFrameworkCore.CodeGenerator", "1.0")]
public static class EntryMetadata
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
using System.Text;
using System.Threading.Tasks;

namespace Havit.Bonusario.Model.Metadata
namespace Havit.Bonusario.Contracts.ModelMetadata
{
[System.CodeDom.Compiler.GeneratedCode("Havit.Data.EntityFrameworkCore.CodeGenerator", "1.0")]
public static class EntryTagMetadata
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
using System.Text;
using System.Threading.Tasks;

namespace Havit.Bonusario.Model.Metadata.Localizations
namespace Havit.Bonusario.Contracts.ModelMetadata.Localizations
{
[System.CodeDom.Compiler.GeneratedCode("Havit.Data.EntityFrameworkCore.CodeGenerator", "1.0")]
public static class LanguageMetadata
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
using System.Text;
using System.Threading.Tasks;

namespace Havit.Bonusario.Model.Metadata
namespace Havit.Bonusario.Contracts.ModelMetadata
{
[System.CodeDom.Compiler.GeneratedCode("Havit.Data.EntityFrameworkCore.CodeGenerator", "1.0")]
public static class PeriodMetadata
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
using System.Text;
using System.Threading.Tasks;

namespace Havit.Bonusario.Model.Metadata
namespace Havit.Bonusario.Contracts.ModelMetadata
{
[System.CodeDom.Compiler.GeneratedCode("Havit.Data.EntityFrameworkCore.CodeGenerator", "1.0")]
public static class PeriodSetMetadata
Expand Down
2 changes: 2 additions & 0 deletions DataLayer.Tests/DataLayer.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<IsPackable>false</IsPackable>
<AssemblyName>Havit.Bonusario.DataLayer.Tests</AssemblyName>
<RootNamespace>Havit.Bonusario.DataLayer.Tests</RootNamespace>
<!-- Nasměrujeme publish složku mimo bin aby nedocházelo ke dvojímu spoštění unit testů (ze bin\Release\netcoreapp a bin\Release\netcoreapp\publish) -->
<PublishDir>obj\$(Configuration)\publish</PublishDir>
</PropertyGroup>

Expand Down
1 change: 1 addition & 0 deletions DataLayer.Tests/GlobalUsings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
global using Havit.Diagnostics.Contracts;
1 change: 1 addition & 0 deletions DataLayer/DataLayer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<AssemblyName>Havit.Bonusario.DataLayer</AssemblyName>
<RootNamespace>Havit.Bonusario.DataLayer</RootNamespace>
</PropertyGroup>
Expand Down
9 changes: 1 addition & 8 deletions DataLayer/GlobalUsings.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1 @@
global using System;
global using System.Collections.Generic;
global using System.Linq;
global using System.Text;
global using System.Threading;
global using System.Threading.Tasks;

global using Havit.Diagnostics.Contracts;
global using Havit.Diagnostics.Contracts;
4 changes: 4 additions & 0 deletions DataLayer/efcore.codegenerator.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"MetadataProjectPath": "Contracts",
"MetadataNamespace": "ModelMetadata"
}
1 change: 1 addition & 0 deletions DependencyInjection/DependencyInjection.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<AssemblyName>Havit.Bonusario.DependencyInjection</AssemblyName>
<RootNamespace>Havit.Bonusario.DependencyInjection</RootNamespace>
</PropertyGroup>
Expand Down
9 changes: 1 addition & 8 deletions DependencyInjection/GlobalUsings.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1 @@
global using System;
global using System.Collections.Generic;
global using System.Linq;
global using System.Text;
global using System.Threading;
global using System.Threading.Tasks;

global using Havit.Diagnostics.Contracts;
global using Havit.Diagnostics.Contracts;
1 change: 1 addition & 0 deletions Entity.Tests/Entity.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<IsPackable>false</IsPackable>
<AssemblyName>Havit.Bonusario.Entity.Tests</AssemblyName>
<RootNamespace>Havit.Bonusario.Entity.Tests</RootNamespace>
Expand Down
1 change: 1 addition & 0 deletions Entity.Tests/GlobalUsings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
global using Havit.Diagnostics.Contracts;
1 change: 1 addition & 0 deletions Entity/Entity.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<AssemblyName>Havit.Bonusario.Entity</AssemblyName>
<RootNamespace>Havit.Bonusario.Entity</RootNamespace>
</PropertyGroup>
Expand Down
1 change: 1 addition & 0 deletions Entity/GlobalUsings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
global using Havit.Diagnostics.Contracts;
2 changes: 2 additions & 0 deletions Facades.Tests/Facades.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<IsPackable>false</IsPackable>
<AssemblyName>Havit.Bonusario.Facades.Tests</AssemblyName>
<RootNamespace>Havit.Bonusario.Facades.Tests</RootNamespace>
<!-- Nasměrujeme publish složku mimo bin aby nedocházelo ke dvojímu spoštění unit testů (ze bin\Release\netcoreapp a bin\Release\netcoreapp\publish) -->
<PublishDir>obj\$(Configuration)\publish</PublishDir>
</PropertyGroup>

Expand Down
1 change: 1 addition & 0 deletions Facades.Tests/GlobalUsings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
global using Havit.Diagnostics.Contracts;
1 change: 1 addition & 0 deletions Facades/Facades.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<AssemblyName>Havit.Bonusario.Facades</AssemblyName>
<RootNamespace>Havit.Bonusario.Facades</RootNamespace>
</PropertyGroup>
Expand Down
2 changes: 2 additions & 0 deletions Facades/GlobalUsings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
global using Havit.Data.Patterns.DataSeeds;
global using Havit.Diagnostics.Contracts;
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,19 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Havit;
using Havit.Data.Patterns.DataSeeds;
using Havit.Data.Patterns.DataSeeds.Profiles;
using Havit.Extensions.DependencyInjection.Abstractions;
using Havit.Bonusario.Contracts;
using Havit.Bonusario.Contracts.System;
using Havit.Bonusario.DataLayer.Seeds.Core;
using Havit.Bonusario.Facades.Infrastructure.Security;
using Havit.Bonusario.Facades.Infrastructure.Security.Authorization;
using Havit.Bonusario.Services.Infrastructure;
using Havit.Services.Caching;
using Microsoft.AspNetCore.Authorization;
using Havit.Bonusario.Contracts.Infrastructure;

namespace Havit.Bonusario.Facades.System
namespace Havit.Bonusario.Facades.Infrastructure.System
{
/// <summary>
/// Fasáda k seedování dat.
Expand Down Expand Up @@ -48,7 +47,7 @@ public Task SeedDataProfile(string profileName)
// they get seeded and another seed asks for GetAll(), the newly seeded entities are not included.
cacheService.Clear();

Type type = GetProfileTypes().FirstOrDefault(item => String.Equals(item.Name, profileName, StringComparison.InvariantCultureIgnoreCase));
Type type = GetProfileTypes().FirstOrDefault(item => string.Equals(item.Name, profileName, StringComparison.InvariantCultureIgnoreCase));

if (type == null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
using System.Threading;
using System.Threading.Tasks;
using Havit.Extensions.DependencyInjection.Abstractions;
using Havit.Bonusario.Contracts.System;
using Havit.Services.Caching;
using Microsoft.AspNetCore.Authorization;
using Havit.Bonusario.Contracts.Infrastructure;

namespace Havit.Bonusario.Facades.System
namespace Havit.Bonusario.Facades.Infrastructure.System
{
[Service]
[Authorize] // TODO Auth
Expand Down
1 change: 1 addition & 0 deletions IntegrationTests/GlobalUsings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
global using Havit.Diagnostics.Contracts;
3 changes: 3 additions & 0 deletions IntegrationTests/IntegrationTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<IsPackable>false</IsPackable>
<AssemblyName>Havit.Bonusario.IntegrationTests</AssemblyName>
<RootNamespace>Havit.Bonusario.IntegrationTests</RootNamespace>
<!-- Nasměrujeme publish složku mimo bin aby nedocházelo ke dvojímu spoštění unit testů (ze bin\Release\netcoreapp a bin\Release\netcoreapp\publish) -->
<PublishDir>obj\$(Configuration)\publish</PublishDir>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions Model.Tests/GlobalUsings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
global using Havit.Diagnostics.Contracts;
2 changes: 2 additions & 0 deletions Model.Tests/Model.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<IsPackable>false</IsPackable>
<AssemblyName>Havit.Bonusario.Model.Tests</AssemblyName>
<RootNamespace>Havit.Bonusario.Model.Tests</RootNamespace>
<!-- Nasměrujeme publish složku mimo bin aby nedocházelo ke dvojímu spoštění unit testů (ze bin\Release\netcoreapp a bin\Release\netcoreapp\publish) -->
<PublishDir>obj\$(Configuration)\publish</PublishDir>
</PropertyGroup>

Expand Down
8 changes: 1 addition & 7 deletions Model/GlobalUsings.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
global using System;
global using System.Collections.Generic;
global using System.ComponentModel.DataAnnotations;
global using System.Linq;
global using System.Text;
global using System.Threading;
global using System.Threading.Tasks;
global using System.ComponentModel.DataAnnotations;

global using Havit.Diagnostics.Contracts;
1 change: 1 addition & 0 deletions Model/Model.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<AssemblyName>Havit.Bonusario.Model</AssemblyName>
<RootNamespace>Havit.Bonusario.Model</RootNamespace>
</PropertyGroup>
Expand Down
27 changes: 14 additions & 13 deletions Resources/Resources.csproj
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<AssemblyName>Havit.Bonusario.Resources</AssemblyName>
<RootNamespace>Havit.Bonusario.Resources</RootNamespace>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<AssemblyName>Havit.Bonusario.Resources</AssemblyName>
<RootNamespace>Havit.Bonusario.Resources</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Havit.Extensions.Localization" Version="1.0.5" />
<PackageReference Include="Havit.SourceGenerators.StrongApiStringLocalizers" Version="1.0.8" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="6.0.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Havit.Extensions.Localization" Version="1.0.5" />
<PackageReference Include="Havit.SourceGenerators.StrongApiStringLocalizers" Version="1.0.8" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="6.0.0" />
</ItemGroup>

<ItemGroup>
<Folder Include="Model\" />
</ItemGroup>
<ItemGroup>
<Folder Include="Model\" />
</ItemGroup>

</Project>
1 change: 1 addition & 0 deletions Services.Tests/GlobalUsings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
global using Havit.Diagnostics.Contracts;
2 changes: 2 additions & 0 deletions Services.Tests/Services.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<IsPackable>false</IsPackable>
<AssemblyName>Havit.Bonusario.Services.Tests</AssemblyName>
<RootNamespace>Havit.Bonusario.Services.Tests</RootNamespace>
<!-- Nasměrujeme publish složku mimo bin aby nedocházelo ke dvojímu spoštění unit testů (ze bin\Release\netcoreapp a bin\Release\netcoreapp\publish) -->
<PublishDir>obj\$(Configuration)\publish</PublishDir>
</PropertyGroup>

Expand Down
1 change: 1 addition & 0 deletions Services/GlobalUsings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
global using Havit.Diagnostics.Contracts;
Loading

0 comments on commit 1ad74aa

Please sign in to comment.