server cleanup

This commit is contained in:
hamid
2026-06-16 01:46:53 +03:30
parent 69bbd28bb0
commit 5b4c0d183f
205 changed files with 641 additions and 628 deletions
@@ -14,7 +14,7 @@
<PackageReference Include="Serilog.Enrichers.Span" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\CleanArc.Infrastructure.Identity\CleanArc.Infrastructure.Identity.csproj" />
<ProjectReference Include="..\CleanArc.Infrastructure.Persistence\CleanArc.Infrastructure.Persistence.csproj" />
<ProjectReference Include="..\Baya.Infrastructure.Identity\Baya.Infrastructure.Identity.csproj" />
<ProjectReference Include="..\Baya.Infrastructure.Persistence\Baya.Infrastructure.Persistence.csproj" />
</ItemGroup>
</Project>
@@ -7,7 +7,7 @@ using Serilog.Exceptions;
using Serilog.Formatting.Json;
using Serilog.Sinks.MSSqlServer;
namespace CleanArc.Infrastructure.CrossCutting.Logging;
namespace Baya.Infrastructure.CrossCutting.Logging;
public static class LoggingConfiguration
{
@@ -13,9 +13,9 @@
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Core\CleanArc.Application\CleanArc.Application.csproj" />
<ProjectReference Include="..\..\Core\CleanArc.Domain\CleanArc.Domain.csproj" />
<ProjectReference Include="..\CleanArc.Infrastructure.Persistence\CleanArc.Infrastructure.Persistence.csproj" />
<ProjectReference Include="..\..\Core\Baya.Application\Baya.Application.csproj" />
<ProjectReference Include="..\..\Core\Baya.Domain\Baya.Domain.csproj" />
<ProjectReference Include="..\Baya.Infrastructure.Persistence\Baya.Infrastructure.Persistence.csproj" />
</ItemGroup>
@@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Identity;
namespace CleanArc.Infrastructure.Identity.Identity;
namespace Baya.Infrastructure.Identity.Identity;
public class AppErrorDescriber:IdentityErrorDescriber
{
@@ -1,10 +1,10 @@
using System.Security.Claims;
using CleanArc.Domain.Entities.User;
using CleanArc.Infrastructure.Identity.Identity.Manager;
using Baya.Domain.Entities.User;
using Baya.Infrastructure.Identity.Identity.Manager;
using Microsoft.AspNetCore.Identity;
using Microsoft.Extensions.Options;
namespace CleanArc.Infrastructure.Identity.Identity;
namespace Baya.Infrastructure.Identity.Identity;
public class AppUserClaimsPrincipleFactory:UserClaimsPrincipalFactory<User,Role>
{
@@ -2,7 +2,7 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Identity;
namespace CleanArc.Infrastructure.Identity.Identity.DataProtection;
namespace Baya.Infrastructure.Identity.Identity.DataProtection;
public class KeyRing : ILookupProtectorKeyRing
{
@@ -4,7 +4,7 @@ using System.Text;
using Microsoft.AspNetCore.Cryptography.KeyDerivation;
using Microsoft.AspNetCore.Identity;
namespace CleanArc.Infrastructure.Identity.Identity.DataProtection;
namespace Baya.Infrastructure.Identity.Identity.DataProtection;
public class LookupProtector : ILookupProtector
{
@@ -4,7 +4,7 @@ using System.Text;
using Microsoft.AspNetCore.Cryptography.KeyDerivation;
using Microsoft.AspNetCore.Identity;
namespace CleanArc.Infrastructure.Identity.Identity.DataProtection;
namespace Baya.Infrastructure.Identity.Identity.DataProtection;
public class PersonalDataProtector : IPersonalDataProtector
{
@@ -1,6 +1,6 @@
using System.Security.Cryptography;
namespace CleanArc.Infrastructure.Identity.Identity.DataProtection;
namespace Baya.Infrastructure.Identity.Identity.DataProtection;
public enum ProtectorAlgorithm
{
@@ -1,4 +1,4 @@
namespace CleanArc.Infrastructure.Identity.Identity.Dtos
namespace Baya.Infrastructure.Identity.Identity.Dtos
{
internal class CustomIdentityConstants
{
@@ -1,4 +1,4 @@
namespace CleanArc.Infrastructure.Identity.Identity.Dtos;
namespace Baya.Infrastructure.Identity.Identity.Dtos;
public class IdentitySettings
{
@@ -3,7 +3,7 @@ using Microsoft.AspNetCore.Identity;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
namespace CleanArc.Infrastructure.Identity.Identity.Extensions;
namespace Baya.Infrastructure.Identity.Identity.Extensions;
public class DataProtectionTokenProviderOptions
{
@@ -1,8 +1,8 @@
using CleanArc.Domain.Entities.User;
using Baya.Domain.Entities.User;
using Microsoft.AspNetCore.Identity;
using Microsoft.Extensions.Logging;
namespace CleanArc.Infrastructure.Identity.Identity.Manager;
namespace Baya.Infrastructure.Identity.Identity.Manager;
public class AppRoleManager:RoleManager<Role>
{
@@ -1,11 +1,11 @@
using CleanArc.Domain.Entities.User;
using Baya.Domain.Entities.User;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Identity;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
namespace CleanArc.Infrastructure.Identity.Identity.Manager;
namespace Baya.Infrastructure.Identity.Identity.Manager;
public class AppSignInManager : SignInManager<User>
{
@@ -1,9 +1,9 @@
using CleanArc.Domain.Entities.User;
using Baya.Domain.Entities.User;
using Microsoft.AspNetCore.Identity;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
namespace CleanArc.Infrastructure.Identity.Identity.Manager;
namespace Baya.Infrastructure.Identity.Identity.Manager;
public class AppUserManager:UserManager<User>
{
@@ -1,4 +1,4 @@
namespace CleanArc.Infrastructure.Identity.Identity.PermissionManager;
namespace Baya.Infrastructure.Identity.Identity.PermissionManager;
public static class ConstantPolicies
{
@@ -2,7 +2,7 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Routing;
namespace CleanArc.Infrastructure.Identity.Identity.PermissionManager;
namespace Baya.Infrastructure.Identity.Identity.PermissionManager;
public class DynamicPermissionRequirement : IAuthorizationRequirement
{
@@ -1,6 +1,6 @@
using System.Security.Claims;
namespace CleanArc.Infrastructure.Identity.Identity.PermissionManager;
namespace Baya.Infrastructure.Identity.Identity.PermissionManager;
public class DynamicPermissionService : IDynamicPermissionService
{
@@ -1,6 +1,6 @@
using System.Security.Claims;
namespace CleanArc.Infrastructure.Identity.Identity.PermissionManager;
namespace Baya.Infrastructure.Identity.Identity.PermissionManager;
public interface IDynamicPermissionService
{
@@ -1,10 +1,10 @@
using System.ComponentModel.DataAnnotations;
using System.Reflection;
using CleanArc.Application.Contracts.Identity;
using CleanArc.Application.Models.Identity;
using CleanArc.Domain.Entities.User;
using CleanArc.Infrastructure.Identity.Identity.Manager;
using CleanArc.Infrastructure.Persistence;
using Baya.Application.Contracts.Identity;
using Baya.Application.Models.Identity;
using Baya.Domain.Entities.User;
using Baya.Infrastructure.Identity.Identity.Manager;
using Baya.Infrastructure.Persistence;
using MapsterMapper;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
@@ -15,7 +15,7 @@ using Microsoft.AspNetCore.Routing;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
namespace CleanArc.Infrastructure.Identity.Identity.PermissionManager;
namespace Baya.Infrastructure.Identity.Identity.PermissionManager;
internal class RoleManagerService : IRoleManagerService
{
@@ -1,8 +1,8 @@
using CleanArc.Domain.Entities.User;
using CleanArc.Infrastructure.Identity.Identity.Manager;
using Baya.Domain.Entities.User;
using Baya.Infrastructure.Identity.Identity.Manager;
using Microsoft.EntityFrameworkCore;
namespace CleanArc.Infrastructure.Identity.Identity.SeedDatabaseService;
namespace Baya.Infrastructure.Identity.Identity.SeedDatabaseService;
public interface ISeedDataBase
{
@@ -1,9 +1,9 @@
using CleanArc.Domain.Entities.User;
using CleanArc.Infrastructure.Persistence;
using Baya.Domain.Entities.User;
using Baya.Infrastructure.Persistence;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
namespace CleanArc.Infrastructure.Identity.Identity.Store;
namespace Baya.Infrastructure.Identity.Identity.Store;
public class AppUserStore:UserStore<User,Role,ApplicationDbContext,int,UserClaim,UserRole,UserLogin,UserToken,RoleClaim>
{
@@ -1,9 +1,9 @@
using CleanArc.Domain.Entities.User;
using CleanArc.Infrastructure.Persistence;
using Baya.Domain.Entities.User;
using Baya.Infrastructure.Persistence;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
namespace CleanArc.Infrastructure.Identity.Identity.Store;
namespace Baya.Infrastructure.Identity.Identity.Store;
public class RoleStore:RoleStore<Role,ApplicationDbContext,int,UserRole,RoleClaim>
{
@@ -1,7 +1,7 @@
using CleanArc.Domain.Entities.User;
using Baya.Domain.Entities.User;
using Microsoft.AspNetCore.Identity;
namespace CleanArc.Infrastructure.Identity.Identity.validator;
namespace Baya.Infrastructure.Identity.Identity.validator;
public class AppRoleValidator:RoleValidator<Role>
{
@@ -1,7 +1,7 @@
using CleanArc.Domain.Entities.User;
using Baya.Domain.Entities.User;
using Microsoft.AspNetCore.Identity;
namespace CleanArc.Infrastructure.Identity.Identity.validator;
namespace Baya.Infrastructure.Identity.Identity.validator;
public class AppUserValidator:UserValidator<User>
{
@@ -1,18 +1,18 @@
using System.IdentityModel.Tokens.Jwt;
using System.Security.Claims;
using System.Text;
using CleanArc.Application.Contracts;
using CleanArc.Application.Contracts.Persistence;
using CleanArc.Application.Models.Jwt;
using CleanArc.Domain.Entities.User;
using CleanArc.Infrastructure.Identity.Identity.Dtos;
using CleanArc.Infrastructure.Identity.Identity.Manager;
using Baya.Application.Contracts;
using Baya.Application.Contracts.Persistence;
using Baya.Application.Models.Jwt;
using Baya.Domain.Entities.User;
using Baya.Infrastructure.Identity.Identity.Dtos;
using Baya.Infrastructure.Identity.Identity.Manager;
using Microsoft.AspNetCore.Identity;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Options;
using Microsoft.IdentityModel.Tokens;
namespace CleanArc.Infrastructure.Identity.Jwt;
namespace Baya.Infrastructure.Identity.Jwt;
public class JwtService : IJwtService
{
@@ -1,20 +1,20 @@
using System.Security.Claims;
using System.Text;
using CleanArc.Application.Contracts;
using CleanArc.Application.Contracts.Identity;
using CleanArc.Application.Models.ApiResult;
using CleanArc.Domain.Entities.User;
using CleanArc.Infrastructure.Identity.Identity;
using CleanArc.Infrastructure.Identity.Identity.Dtos;
using CleanArc.Infrastructure.Identity.Identity.Extensions;
using CleanArc.Infrastructure.Identity.Identity.Manager;
using CleanArc.Infrastructure.Identity.Identity.PermissionManager;
using CleanArc.Infrastructure.Identity.Identity.SeedDatabaseService;
using CleanArc.Infrastructure.Identity.Identity.Store;
using CleanArc.Infrastructure.Identity.Identity.validator;
using CleanArc.Infrastructure.Identity.Jwt;
using CleanArc.Infrastructure.Identity.UserManager;
using CleanArc.SharedKernel.Extensions;
using Baya.Application.Contracts;
using Baya.Application.Contracts.Identity;
using Baya.Application.Models.ApiResult;
using Baya.Domain.Entities.User;
using Baya.Infrastructure.Identity.Identity;
using Baya.Infrastructure.Identity.Identity.Dtos;
using Baya.Infrastructure.Identity.Identity.Extensions;
using Baya.Infrastructure.Identity.Identity.Manager;
using Baya.Infrastructure.Identity.Identity.PermissionManager;
using Baya.Infrastructure.Identity.Identity.SeedDatabaseService;
using Baya.Infrastructure.Identity.Identity.Store;
using Baya.Infrastructure.Identity.Identity.validator;
using Baya.Infrastructure.Identity.Jwt;
using Baya.Infrastructure.Identity.UserManager;
using Baya.SharedKernel.Extensions;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Builder;
@@ -23,7 +23,7 @@ using Microsoft.AspNetCore.Identity;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.IdentityModel.Tokens;
namespace CleanArc.Infrastructure.Identity.ServiceConfiguration;
namespace Baya.Infrastructure.Identity.ServiceConfiguration;
public static class ServiceCollectionExtension
{
@@ -1,11 +1,11 @@
using CleanArc.Application.Contracts.Identity;
using CleanArc.Domain.Entities.User;
using CleanArc.Infrastructure.Identity.Identity.Dtos;
using CleanArc.Infrastructure.Identity.Identity.Manager;
using Baya.Application.Contracts.Identity;
using Baya.Domain.Entities.User;
using Baya.Infrastructure.Identity.Identity.Dtos;
using Baya.Infrastructure.Identity.Identity.Manager;
using Microsoft.AspNetCore.Identity;
using Microsoft.EntityFrameworkCore;
namespace CleanArc.Infrastructure.Identity.UserManager;
namespace Baya.Infrastructure.Identity.UserManager;
public class AppUserManagerImplementation : IAppUserManager
{
@@ -7,7 +7,7 @@ using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Prometheus;
namespace CleanArc.Infrastructure.Monitoring.Configurations;
namespace Baya.Infrastructure.Monitoring.Configurations;
public static class HealthCheckConfigurations
{
@@ -2,7 +2,7 @@
using Microsoft.Extensions.DependencyInjection;
using OpenTelemetry.Metrics;
namespace CleanArc.Infrastructure.Monitoring.Configurations;
namespace Baya.Infrastructure.Monitoring.Configurations;
public static class OpenTelemetryConfigurations
{
@@ -16,7 +16,7 @@ public static class OpenTelemetryConfigurations
.AddMeter("Microsoft.AspNetCore.Hosting"
, "Microsoft.AspNetCore.Server.Kestrel"
, "System.Net.Http"
, "CleanArc.Web.Api"
, "Baya.Web.Api"
, "ControllerMetrics")
.AddPrometheusExporter();
});
@@ -1,7 +1,7 @@
using Microsoft.AspNetCore.Builder;
using Prometheus;
namespace CleanArc.Infrastructure.Monitoring.Configurations;
namespace Baya.Infrastructure.Monitoring.Configurations;
public static class PrometheusMetricsConfigurations
{
@@ -1,11 +1,11 @@
using System.Reflection;
using CleanArc.Domain.Common;
using CleanArc.Domain.Entities.User;
using CleanArc.SharedKernel.Extensions;
using Baya.Domain.Common;
using Baya.Domain.Entities.User;
using Baya.SharedKernel.Extensions;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
namespace CleanArc.Infrastructure.Persistence;
namespace Baya.Infrastructure.Persistence;
public class ApplicationDbContext: IdentityDbContext<User, Role, int, UserClaim, UserRole, UserLogin, RoleClaim, UserToken>
{
@@ -14,8 +14,8 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Core\CleanArc.Application\CleanArc.Application.csproj" />
<ProjectReference Include="..\..\Core\CleanArc.Domain\CleanArc.Domain.csproj" />
<ProjectReference Include="..\..\Core\Baya.Application\Baya.Application.csproj" />
<ProjectReference Include="..\..\Core\Baya.Domain\Baya.Domain.csproj" />
</ItemGroup>
</Project>
@@ -1,8 +1,8 @@
using CleanArc.Domain.Entities.Order;
using Baya.Domain.Entities.Order;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace CleanArc.Infrastructure.Persistence.Configuration.OrderConfig;
namespace Baya.Infrastructure.Persistence.Configuration.OrderConfig;
internal class OrderConfig:IEntityTypeConfiguration<Order>
{
@@ -1,8 +1,8 @@
using CleanArc.Domain.Entities.User;
using Baya.Domain.Entities.User;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace CleanArc.Infrastructure.Persistence.Configuration.UserConfig;
namespace Baya.Infrastructure.Persistence.Configuration.UserConfig;
internal class RefreshTokenConfig:IEntityTypeConfiguration<UserRefreshToken>
{
@@ -1,8 +1,8 @@
using CleanArc.Domain.Entities.User;
using Baya.Domain.Entities.User;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace CleanArc.Infrastructure.Persistence.Configuration.UserConfig;
namespace Baya.Infrastructure.Persistence.Configuration.UserConfig;
internal class RoleClaimConfig:IEntityTypeConfiguration<RoleClaim>
{
@@ -1,8 +1,8 @@
using CleanArc.Domain.Entities.User;
using Baya.Domain.Entities.User;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace CleanArc.Infrastructure.Persistence.Configuration.UserConfig;
namespace Baya.Infrastructure.Persistence.Configuration.UserConfig;
internal class RoleConfig:IEntityTypeConfiguration<Role>
{
@@ -1,8 +1,8 @@
using CleanArc.Domain.Entities.User;
using Baya.Domain.Entities.User;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace CleanArc.Infrastructure.Persistence.Configuration.UserConfig;
namespace Baya.Infrastructure.Persistence.Configuration.UserConfig;
internal class UserClaimConfig:IEntityTypeConfiguration<UserClaim>
{
@@ -1,8 +1,8 @@
using CleanArc.Domain.Entities.User;
using Baya.Domain.Entities.User;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace CleanArc.Infrastructure.Persistence.Configuration.UserConfig;
namespace Baya.Infrastructure.Persistence.Configuration.UserConfig;
internal class UserConfig:IEntityTypeConfiguration<User>
{
@@ -1,8 +1,8 @@
using CleanArc.Domain.Entities.User;
using Baya.Domain.Entities.User;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace CleanArc.Infrastructure.Persistence.Configuration.UserConfig;
namespace Baya.Infrastructure.Persistence.Configuration.UserConfig;
internal class UserLoginConfig:IEntityTypeConfiguration<UserLogin>
{
@@ -1,8 +1,8 @@
using CleanArc.Domain.Entities.User;
using Baya.Domain.Entities.User;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace CleanArc.Infrastructure.Persistence.Configuration.UserConfig;
namespace Baya.Infrastructure.Persistence.Configuration.UserConfig;
internal class UserRoleConfig:IEntityTypeConfiguration<UserRole>
{
@@ -1,8 +1,8 @@
using CleanArc.Domain.Entities.User;
using Baya.Domain.Entities.User;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace CleanArc.Infrastructure.Persistence.Configuration.UserConfig;
namespace Baya.Infrastructure.Persistence.Configuration.UserConfig;
internal class UserTokenConfig:IEntityTypeConfiguration<UserToken>
{
@@ -1,6 +1,6 @@
// <auto-generated />
using System;
using CleanArc.Infrastructure.Persistence;
using Baya.Infrastructure.Persistence;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
@@ -1,6 +1,6 @@
// <auto-generated />
using System;
using CleanArc.Infrastructure.Persistence;
using Baya.Infrastructure.Persistence;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
@@ -1,6 +1,6 @@
// <auto-generated />
using System;
using CleanArc.Infrastructure.Persistence;
using Baya.Infrastructure.Persistence;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
@@ -25,7 +25,7 @@ namespace Persistence.Migrations
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("CleanArc.Domain.Entities.Order.Order", b =>
modelBuilder.Entity("Baya.Domain.Entities.Order.Order", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
@@ -55,7 +55,7 @@ namespace Persistence.Migrations
b.ToTable("Orders");
});
modelBuilder.Entity("CleanArc.Domain.Entities.User.Role", b =>
modelBuilder.Entity("Baya.Domain.Entities.User.Role", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
@@ -91,7 +91,7 @@ namespace Persistence.Migrations
b.ToTable("Roles", "usr");
});
modelBuilder.Entity("CleanArc.Domain.Entities.User.RoleClaim", b =>
modelBuilder.Entity("Baya.Domain.Entities.User.RoleClaim", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
@@ -118,7 +118,7 @@ namespace Persistence.Migrations
b.ToTable("RoleClaims", "usr");
});
modelBuilder.Entity("CleanArc.Domain.Entities.User.User", b =>
modelBuilder.Entity("Baya.Domain.Entities.User.User", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
@@ -196,7 +196,7 @@ namespace Persistence.Migrations
b.ToTable("Users", "usr");
});
modelBuilder.Entity("CleanArc.Domain.Entities.User.UserClaim", b =>
modelBuilder.Entity("Baya.Domain.Entities.User.UserClaim", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
@@ -220,7 +220,7 @@ namespace Persistence.Migrations
b.ToTable("UserClaims", "usr");
});
modelBuilder.Entity("CleanArc.Domain.Entities.User.UserLogin", b =>
modelBuilder.Entity("Baya.Domain.Entities.User.UserLogin", b =>
{
b.Property<string>("LoginProvider")
.HasColumnType("nvarchar(450)");
@@ -244,7 +244,7 @@ namespace Persistence.Migrations
b.ToTable("UserLogins", "usr");
});
modelBuilder.Entity("CleanArc.Domain.Entities.User.UserRefreshToken", b =>
modelBuilder.Entity("Baya.Domain.Entities.User.UserRefreshToken", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
@@ -272,7 +272,7 @@ namespace Persistence.Migrations
b.ToTable("UserRefreshTokens", "usr");
});
modelBuilder.Entity("CleanArc.Domain.Entities.User.UserRole", b =>
modelBuilder.Entity("Baya.Domain.Entities.User.UserRole", b =>
{
b.Property<int>("UserId")
.HasColumnType("int");
@@ -290,7 +290,7 @@ namespace Persistence.Migrations
b.ToTable("UserRoles", "usr");
});
modelBuilder.Entity("CleanArc.Domain.Entities.User.UserToken", b =>
modelBuilder.Entity("Baya.Domain.Entities.User.UserToken", b =>
{
b.Property<int>("UserId")
.HasColumnType("int");
@@ -312,9 +312,9 @@ namespace Persistence.Migrations
b.ToTable("UserTokens", "usr");
});
modelBuilder.Entity("CleanArc.Domain.Entities.Order.Order", b =>
modelBuilder.Entity("Baya.Domain.Entities.Order.Order", b =>
{
b.HasOne("CleanArc.Domain.Entities.User.User", "User")
b.HasOne("Baya.Domain.Entities.User.User", "User")
.WithMany("Orders")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Restrict)
@@ -323,9 +323,9 @@ namespace Persistence.Migrations
b.Navigation("User");
});
modelBuilder.Entity("CleanArc.Domain.Entities.User.RoleClaim", b =>
modelBuilder.Entity("Baya.Domain.Entities.User.RoleClaim", b =>
{
b.HasOne("CleanArc.Domain.Entities.User.Role", "Role")
b.HasOne("Baya.Domain.Entities.User.Role", "Role")
.WithMany("Claims")
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Restrict)
@@ -334,9 +334,9 @@ namespace Persistence.Migrations
b.Navigation("Role");
});
modelBuilder.Entity("CleanArc.Domain.Entities.User.UserClaim", b =>
modelBuilder.Entity("Baya.Domain.Entities.User.UserClaim", b =>
{
b.HasOne("CleanArc.Domain.Entities.User.User", "User")
b.HasOne("Baya.Domain.Entities.User.User", "User")
.WithMany("Claims")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Restrict)
@@ -345,9 +345,9 @@ namespace Persistence.Migrations
b.Navigation("User");
});
modelBuilder.Entity("CleanArc.Domain.Entities.User.UserLogin", b =>
modelBuilder.Entity("Baya.Domain.Entities.User.UserLogin", b =>
{
b.HasOne("CleanArc.Domain.Entities.User.User", "User")
b.HasOne("Baya.Domain.Entities.User.User", "User")
.WithMany("Logins")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Restrict)
@@ -356,9 +356,9 @@ namespace Persistence.Migrations
b.Navigation("User");
});
modelBuilder.Entity("CleanArc.Domain.Entities.User.UserRefreshToken", b =>
modelBuilder.Entity("Baya.Domain.Entities.User.UserRefreshToken", b =>
{
b.HasOne("CleanArc.Domain.Entities.User.User", "User")
b.HasOne("Baya.Domain.Entities.User.User", "User")
.WithMany("UserRefreshTokens")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Restrict)
@@ -367,15 +367,15 @@ namespace Persistence.Migrations
b.Navigation("User");
});
modelBuilder.Entity("CleanArc.Domain.Entities.User.UserRole", b =>
modelBuilder.Entity("Baya.Domain.Entities.User.UserRole", b =>
{
b.HasOne("CleanArc.Domain.Entities.User.Role", "Role")
b.HasOne("Baya.Domain.Entities.User.Role", "Role")
.WithMany("Users")
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("CleanArc.Domain.Entities.User.User", "User")
b.HasOne("Baya.Domain.Entities.User.User", "User")
.WithMany("UserRoles")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Restrict)
@@ -386,9 +386,9 @@ namespace Persistence.Migrations
b.Navigation("User");
});
modelBuilder.Entity("CleanArc.Domain.Entities.User.UserToken", b =>
modelBuilder.Entity("Baya.Domain.Entities.User.UserToken", b =>
{
b.HasOne("CleanArc.Domain.Entities.User.User", "User")
b.HasOne("Baya.Domain.Entities.User.User", "User")
.WithMany("Tokens")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Restrict)
@@ -397,14 +397,14 @@ namespace Persistence.Migrations
b.Navigation("User");
});
modelBuilder.Entity("CleanArc.Domain.Entities.User.Role", b =>
modelBuilder.Entity("Baya.Domain.Entities.User.Role", b =>
{
b.Navigation("Claims");
b.Navigation("Users");
});
modelBuilder.Entity("CleanArc.Domain.Entities.User.User", b =>
modelBuilder.Entity("Baya.Domain.Entities.User.User", b =>
{
b.Navigation("Claims");
@@ -1,6 +1,6 @@
// <auto-generated />
using System;
using CleanArc.Infrastructure.Persistence;
using Baya.Infrastructure.Persistence;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
@@ -22,7 +22,7 @@ namespace Persistence.Migrations
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("CleanArc.Domain.Entities.Order.Order", b =>
modelBuilder.Entity("Baya.Domain.Entities.Order.Order", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
@@ -52,7 +52,7 @@ namespace Persistence.Migrations
b.ToTable("Orders", (string)null);
});
modelBuilder.Entity("CleanArc.Domain.Entities.User.Role", b =>
modelBuilder.Entity("Baya.Domain.Entities.User.Role", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
@@ -88,7 +88,7 @@ namespace Persistence.Migrations
b.ToTable("Roles", "usr");
});
modelBuilder.Entity("CleanArc.Domain.Entities.User.RoleClaim", b =>
modelBuilder.Entity("Baya.Domain.Entities.User.RoleClaim", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
@@ -115,7 +115,7 @@ namespace Persistence.Migrations
b.ToTable("RoleClaims", "usr");
});
modelBuilder.Entity("CleanArc.Domain.Entities.User.User", b =>
modelBuilder.Entity("Baya.Domain.Entities.User.User", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
@@ -193,7 +193,7 @@ namespace Persistence.Migrations
b.ToTable("Users", "usr");
});
modelBuilder.Entity("CleanArc.Domain.Entities.User.UserClaim", b =>
modelBuilder.Entity("Baya.Domain.Entities.User.UserClaim", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
@@ -217,7 +217,7 @@ namespace Persistence.Migrations
b.ToTable("UserClaims", "usr");
});
modelBuilder.Entity("CleanArc.Domain.Entities.User.UserLogin", b =>
modelBuilder.Entity("Baya.Domain.Entities.User.UserLogin", b =>
{
b.Property<string>("LoginProvider")
.HasColumnType("nvarchar(450)");
@@ -241,7 +241,7 @@ namespace Persistence.Migrations
b.ToTable("UserLogins", "usr");
});
modelBuilder.Entity("CleanArc.Domain.Entities.User.UserRefreshToken", b =>
modelBuilder.Entity("Baya.Domain.Entities.User.UserRefreshToken", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
@@ -269,7 +269,7 @@ namespace Persistence.Migrations
b.ToTable("UserRefreshTokens", "usr");
});
modelBuilder.Entity("CleanArc.Domain.Entities.User.UserRole", b =>
modelBuilder.Entity("Baya.Domain.Entities.User.UserRole", b =>
{
b.Property<int>("UserId")
.HasColumnType("int");
@@ -287,7 +287,7 @@ namespace Persistence.Migrations
b.ToTable("UserRoles", "usr");
});
modelBuilder.Entity("CleanArc.Domain.Entities.User.UserToken", b =>
modelBuilder.Entity("Baya.Domain.Entities.User.UserToken", b =>
{
b.Property<int>("UserId")
.HasColumnType("int");
@@ -309,9 +309,9 @@ namespace Persistence.Migrations
b.ToTable("UserTokens", "usr");
});
modelBuilder.Entity("CleanArc.Domain.Entities.Order.Order", b =>
modelBuilder.Entity("Baya.Domain.Entities.Order.Order", b =>
{
b.HasOne("CleanArc.Domain.Entities.User.User", "User")
b.HasOne("Baya.Domain.Entities.User.User", "User")
.WithMany("Orders")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Restrict)
@@ -320,9 +320,9 @@ namespace Persistence.Migrations
b.Navigation("User");
});
modelBuilder.Entity("CleanArc.Domain.Entities.User.RoleClaim", b =>
modelBuilder.Entity("Baya.Domain.Entities.User.RoleClaim", b =>
{
b.HasOne("CleanArc.Domain.Entities.User.Role", "Role")
b.HasOne("Baya.Domain.Entities.User.Role", "Role")
.WithMany("Claims")
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Restrict)
@@ -331,9 +331,9 @@ namespace Persistence.Migrations
b.Navigation("Role");
});
modelBuilder.Entity("CleanArc.Domain.Entities.User.UserClaim", b =>
modelBuilder.Entity("Baya.Domain.Entities.User.UserClaim", b =>
{
b.HasOne("CleanArc.Domain.Entities.User.User", "User")
b.HasOne("Baya.Domain.Entities.User.User", "User")
.WithMany("Claims")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Restrict)
@@ -342,9 +342,9 @@ namespace Persistence.Migrations
b.Navigation("User");
});
modelBuilder.Entity("CleanArc.Domain.Entities.User.UserLogin", b =>
modelBuilder.Entity("Baya.Domain.Entities.User.UserLogin", b =>
{
b.HasOne("CleanArc.Domain.Entities.User.User", "User")
b.HasOne("Baya.Domain.Entities.User.User", "User")
.WithMany("Logins")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Restrict)
@@ -353,9 +353,9 @@ namespace Persistence.Migrations
b.Navigation("User");
});
modelBuilder.Entity("CleanArc.Domain.Entities.User.UserRefreshToken", b =>
modelBuilder.Entity("Baya.Domain.Entities.User.UserRefreshToken", b =>
{
b.HasOne("CleanArc.Domain.Entities.User.User", "User")
b.HasOne("Baya.Domain.Entities.User.User", "User")
.WithMany("UserRefreshTokens")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Restrict)
@@ -364,15 +364,15 @@ namespace Persistence.Migrations
b.Navigation("User");
});
modelBuilder.Entity("CleanArc.Domain.Entities.User.UserRole", b =>
modelBuilder.Entity("Baya.Domain.Entities.User.UserRole", b =>
{
b.HasOne("CleanArc.Domain.Entities.User.Role", "Role")
b.HasOne("Baya.Domain.Entities.User.Role", "Role")
.WithMany("Users")
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("CleanArc.Domain.Entities.User.User", "User")
b.HasOne("Baya.Domain.Entities.User.User", "User")
.WithMany("UserRoles")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Restrict)
@@ -383,9 +383,9 @@ namespace Persistence.Migrations
b.Navigation("User");
});
modelBuilder.Entity("CleanArc.Domain.Entities.User.UserToken", b =>
modelBuilder.Entity("Baya.Domain.Entities.User.UserToken", b =>
{
b.HasOne("CleanArc.Domain.Entities.User.User", "User")
b.HasOne("Baya.Domain.Entities.User.User", "User")
.WithMany("Tokens")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Restrict)
@@ -394,14 +394,14 @@ namespace Persistence.Migrations
b.Navigation("User");
});
modelBuilder.Entity("CleanArc.Domain.Entities.User.Role", b =>
modelBuilder.Entity("Baya.Domain.Entities.User.Role", b =>
{
b.Navigation("Claims");
b.Navigation("Users");
});
modelBuilder.Entity("CleanArc.Domain.Entities.User.User", b =>
modelBuilder.Entity("Baya.Domain.Entities.User.User", b =>
{
b.Navigation("Claims");
@@ -1,9 +1,9 @@
using System.Linq.Expressions;
using CleanArc.Domain.Common;
using Baya.Domain.Common;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Query;
namespace CleanArc.Infrastructure.Persistence.Repositories.Common;
namespace Baya.Infrastructure.Persistence.Repositories.Common;
internal abstract class BaseAsyncRepository<TEntity> where TEntity:class,IEntity
{
@@ -1,6 +1,6 @@
using CleanArc.Application.Contracts.Persistence;
using Baya.Application.Contracts.Persistence;
namespace CleanArc.Infrastructure.Persistence.Repositories.Common;
namespace Baya.Infrastructure.Persistence.Repositories.Common;
public class UnitOfWork : IUnitOfWork
{
@@ -1,9 +1,9 @@
using CleanArc.Application.Contracts.Persistence;
using CleanArc.Domain.Entities.Order;
using CleanArc.Infrastructure.Persistence.Repositories.Common;
using Baya.Application.Contracts.Persistence;
using Baya.Domain.Entities.Order;
using Baya.Infrastructure.Persistence.Repositories.Common;
using Microsoft.EntityFrameworkCore;
namespace CleanArc.Infrastructure.Persistence.Repositories;
namespace Baya.Infrastructure.Persistence.Repositories;
internal class OrderRepository(ApplicationDbContext dbContext) : BaseAsyncRepository<Order>(dbContext), IOrderRepository
{
@@ -1,9 +1,9 @@
using CleanArc.Application.Contracts.Persistence;
using CleanArc.Domain.Entities.User;
using CleanArc.Infrastructure.Persistence.Repositories.Common;
using Baya.Application.Contracts.Persistence;
using Baya.Domain.Entities.User;
using Baya.Infrastructure.Persistence.Repositories.Common;
using Microsoft.EntityFrameworkCore;
namespace CleanArc.Infrastructure.Persistence.Repositories;
namespace Baya.Infrastructure.Persistence.Repositories;
internal class UserRefreshTokenRepository : BaseAsyncRepository<UserRefreshToken>, IUserRefreshTokenRepository
{
@@ -1,11 +1,11 @@
using CleanArc.Application.Contracts.Persistence;
using CleanArc.Infrastructure.Persistence.Repositories.Common;
using Baya.Application.Contracts.Persistence;
using Baya.Infrastructure.Persistence.Repositories.Common;
using Microsoft.AspNetCore.Builder;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
namespace CleanArc.Infrastructure.Persistence.ServiceConfiguration;
namespace Baya.Infrastructure.Persistence.ServiceConfiguration;
public static class ServiceCollectionExtensions
{