diff --git a/.env.example b/.env.example
new file mode 100644
index 0000000..3e12b4e
--- /dev/null
+++ b/.env.example
@@ -0,0 +1,21 @@
+# Copy to .env and fill in the secrets. .env is gitignored.
+
+# Postgres superuser password shared by the per-service database containers.
+POSTGRES_PASSWORD=lovenet
+
+# HS512 signing key shared by all services (Identity signs, everyone validates).
+# Use a long random string (64+ chars).
+JWT_KEY=REPLACE_WITH_A_LONG_RANDOM_SECRET_OF_AT_LEAST_64_CHARACTERS________
+JWT_ISSUER=https://localhost:3000/
+JWT_AUDIENCE=https://localhost:3000/
+
+# Cloudinary (image storage) — same account the monolith used.
+CLOUDINARY_CLOUD_NAME=
+CLOUDINARY_KEY=
+CLOUDINARY_SECRET=
+
+# SendGrid (transactional email).
+SENDGRID_API_KEY=
+
+# SPA origin allowed by CORS.
+FRONTEND_ORIGIN=http://localhost:3000
diff --git a/Data/LOVE.NET.Data.Common/IDbQueryRunner.cs b/Data/LOVE.NET.Data.Common/IDbQueryRunner.cs
deleted file mode 100644
index 8b4b70a..0000000
--- a/Data/LOVE.NET.Data.Common/IDbQueryRunner.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-namespace LOVE.NET.Data.Common
-{
- using System;
- using System.Threading.Tasks;
-
- public interface IDbQueryRunner : IDisposable
- {
- Task RunQueryAsync(string query, params object[] parameters);
- }
-}
diff --git a/Data/LOVE.NET.Data.Common/LOVE.NET.Data.Common.csproj b/Data/LOVE.NET.Data.Common/LOVE.NET.Data.Common.csproj
deleted file mode 100644
index 0826740..0000000
--- a/Data/LOVE.NET.Data.Common/LOVE.NET.Data.Common.csproj
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
- net8.0
- latest
-
-
-
- ..\..\Rules.ruleset
-
-
-
-
-
-
-
- runtime; build; native; contentfiles; analyzers
-
-
-
-
-
\ No newline at end of file
diff --git a/Data/LOVE.NET.Data.Common/Models/BaseDeletableModel.cs b/Data/LOVE.NET.Data.Common/Models/BaseDeletableModel.cs
deleted file mode 100644
index 4694193..0000000
--- a/Data/LOVE.NET.Data.Common/Models/BaseDeletableModel.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-namespace LOVE.NET.Data.Common.Models
-{
- using System;
-
- public abstract class BaseDeletableModel : BaseModel, IDeletableEntity
- {
- public bool IsDeleted { get; set; }
-
- public DateTime? DeletedOn { get; set; }
- }
-}
diff --git a/Data/LOVE.NET.Data.Common/Models/BaseModel.cs b/Data/LOVE.NET.Data.Common/Models/BaseModel.cs
deleted file mode 100644
index a7e68d7..0000000
--- a/Data/LOVE.NET.Data.Common/Models/BaseModel.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-namespace LOVE.NET.Data.Common.Models
-{
- using System;
- using System.ComponentModel.DataAnnotations;
-
- public abstract class BaseModel : IAuditInfo
- {
- [Key]
- public TKey Id { get; set; }
-
- public DateTime CreatedOn { get; set; }
-
- public DateTime? ModifiedOn { get; set; }
- }
-}
diff --git a/Data/LOVE.NET.Data.Common/Models/IAuditInfo.cs b/Data/LOVE.NET.Data.Common/Models/IAuditInfo.cs
deleted file mode 100644
index e45e245..0000000
--- a/Data/LOVE.NET.Data.Common/Models/IAuditInfo.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-namespace LOVE.NET.Data.Common.Models
-{
- using System;
-
- public interface IAuditInfo
- {
- DateTime CreatedOn { get; set; }
-
- DateTime? ModifiedOn { get; set; }
- }
-}
diff --git a/Data/LOVE.NET.Data.Common/Models/IDeletableEntity.cs b/Data/LOVE.NET.Data.Common/Models/IDeletableEntity.cs
deleted file mode 100644
index d095fbd..0000000
--- a/Data/LOVE.NET.Data.Common/Models/IDeletableEntity.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-namespace LOVE.NET.Data.Common.Models
-{
- using System;
-
- public interface IDeletableEntity
- {
- bool IsDeleted { get; set; }
-
- DateTime? DeletedOn { get; set; }
- }
-}
diff --git a/Data/LOVE.NET.Data.Common/Repositories/IDeletableEntityRepository.cs b/Data/LOVE.NET.Data.Common/Repositories/IDeletableEntityRepository.cs
deleted file mode 100644
index 70127ff..0000000
--- a/Data/LOVE.NET.Data.Common/Repositories/IDeletableEntityRepository.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-namespace LOVE.NET.Data.Common.Repositories
-{
- using System.Linq;
-
- using LOVE.NET.Data.Common.Models;
-
- public interface IDeletableEntityRepository : IRepository
- where TEntity : class, IDeletableEntity
- {
- IQueryable AllWithDeleted();
-
- IQueryable AllAsNoTrackingWithDeleted();
-
- void HardDelete(TEntity entity);
-
- void Undelete(TEntity entity);
- }
-}
diff --git a/Data/LOVE.NET.Data.Common/Repositories/IRepository.cs b/Data/LOVE.NET.Data.Common/Repositories/IRepository.cs
deleted file mode 100644
index 7d2dd86..0000000
--- a/Data/LOVE.NET.Data.Common/Repositories/IRepository.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-namespace LOVE.NET.Data.Common.Repositories
-{
- using System;
- using System.Linq;
- using System.Threading.Tasks;
-
- public interface IRepository : IDisposable
- where TEntity : class
- {
- IQueryable All();
-
- IQueryable AllAsNoTracking();
-
- Task AddAsync(TEntity entity);
-
- void Update(TEntity entity);
-
- void Delete(TEntity entity);
-
- Task SaveChangesAsync();
- }
-}
diff --git a/Data/LOVE.NET.Data.Models/ApplicationRole.cs b/Data/LOVE.NET.Data.Models/ApplicationRole.cs
deleted file mode 100644
index 7329151..0000000
--- a/Data/LOVE.NET.Data.Models/ApplicationRole.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-// ReSharper disable VirtualMemberCallInConstructor
-namespace LOVE.NET.Data.Models
-{
- using System;
-
- using LOVE.NET.Data.Common.Models;
-
- using Microsoft.AspNetCore.Identity;
-
- public class ApplicationRole : IdentityRole, IAuditInfo, IDeletableEntity
- {
- public ApplicationRole()
- : this(null)
- {
- }
-
- public ApplicationRole(string name)
- : base(name)
- {
- this.Id = Guid.NewGuid().ToString();
- }
-
- public DateTime CreatedOn { get; set; }
-
- public DateTime? ModifiedOn { get; set; }
-
- public bool IsDeleted { get; set; }
-
- public DateTime? DeletedOn { get; set; }
- }
-}
diff --git a/Data/LOVE.NET.Data.Models/ApplicationUser.cs b/Data/LOVE.NET.Data.Models/ApplicationUser.cs
deleted file mode 100644
index 0dc29ca..0000000
--- a/Data/LOVE.NET.Data.Models/ApplicationUser.cs
+++ /dev/null
@@ -1,77 +0,0 @@
-// ReSharper disable VirtualMemberCallInConstructor
-namespace LOVE.NET.Data.Models
-{
- using System;
- using System.Collections.Generic;
- using System.ComponentModel.DataAnnotations;
- using System.ComponentModel.DataAnnotations.Schema;
-
- using LOVE.NET.Data.Common.Models;
-
- using Microsoft.AspNetCore.Identity;
-
- public class ApplicationUser : IdentityUser, IAuditInfo, IDeletableEntity
- {
- public ApplicationUser()
- {
- this.Id = Guid.NewGuid().ToString();
- this.Roles = new HashSet>();
- this.Claims = new HashSet>();
- this.Logins = new HashSet>();
- this.LikesSent = new HashSet();
- this.LikesReceived = new HashSet();
- this.Images = new HashSet();
- this.RefreshTokens = new HashSet();
- this.Messages = new HashSet();
- }
-
- // Audit info
- public DateTime CreatedOn { get; set; }
-
- public DateTime? ModifiedOn { get; set; }
-
- // Deletable entity
- public bool IsDeleted { get; set; }
-
- public DateTime? DeletedOn { get; set; }
-
- [Required]
- [MaxLength(255)]
- public string Bio { get; set; }
-
- public DateTime Birthdate { get; set; }
-
- public virtual ICollection> Roles { get; set; }
-
- public virtual ICollection> Claims { get; set; }
-
- public virtual ICollection> Logins { get; set; }
-
- [InverseProperty(nameof(Like.User))]
- public virtual ICollection LikesSent { get; set; }
-
- [InverseProperty(nameof(Like.LikedUser))]
- public virtual ICollection LikesReceived { get; set; }
-
- public virtual ICollection Images { get; set; }
-
- public int GenderId { get; set; }
-
- [Required]
- public virtual Gender Gender { get; set; }
-
- public int CountryId { get; set; }
-
- [Required]
- public virtual Country Country { get; set; }
-
- public int CityId { get; set; }
-
- [Required]
- public virtual City City { get; set; }
-
- public virtual ICollection RefreshTokens { get; set; }
-
- public virtual ICollection Messages { get; set; }
- }
-}
diff --git a/Data/LOVE.NET.Data.Models/Chatroom.cs b/Data/LOVE.NET.Data.Models/Chatroom.cs
deleted file mode 100644
index 6cf93f4..0000000
--- a/Data/LOVE.NET.Data.Models/Chatroom.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-namespace LOVE.NET.Data.Models
-{
- using System;
-
- using LOVE.NET.Data.Common.Models;
-
- public class Chatroom : BaseModel
- {
- public Chatroom()
- {
- this.Id = Guid.NewGuid().ToString();
- }
-
- public string Title { get; set; }
-
- public string Url { get; set; }
- }
-}
diff --git a/Data/LOVE.NET.Data.Models/City.cs b/Data/LOVE.NET.Data.Models/City.cs
deleted file mode 100644
index d7330e3..0000000
--- a/Data/LOVE.NET.Data.Models/City.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-namespace LOVE.NET.Data.Models
-{
- using System.Collections.Generic;
- using System.ComponentModel.DataAnnotations;
-
- using LOVE.NET.Data.Common.Models;
-
- public class City : BaseModel
- {
- public City()
- {
- this.Users = new HashSet();
- }
-
- [Required]
- [MaxLength(255)]
- public string Name { get; set; }
-
- [Required]
- [MaxLength(255)]
- public string NameAscii { get; set; }
-
- public double Latitude { get; set; }
-
- public double Longitude { get; set; }
-
- public int CountryId { get; set; }
-
- public virtual Country Country { get; set; }
-
- public virtual ICollection Users { get; set; }
- }
-}
diff --git a/Data/LOVE.NET.Data.Models/Country.cs b/Data/LOVE.NET.Data.Models/Country.cs
deleted file mode 100644
index 04243b8..0000000
--- a/Data/LOVE.NET.Data.Models/Country.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-namespace LOVE.NET.Data.Models
-{
- using System.Collections.Generic;
- using System.ComponentModel.DataAnnotations;
-
- using LOVE.NET.Data.Common.Models;
-
- public class Country : BaseModel
- {
- public Country()
- {
- this.Cities = new HashSet();
- this.Users = new HashSet();
- }
-
- [Required]
- [MaxLength(100)]
- public string Name { get; set; }
-
- public virtual ICollection Cities { get; set; }
-
- public virtual ICollection Users { get; set; }
- }
-}
diff --git a/Data/LOVE.NET.Data.Models/Gender.cs b/Data/LOVE.NET.Data.Models/Gender.cs
deleted file mode 100644
index 74f204b..0000000
--- a/Data/LOVE.NET.Data.Models/Gender.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-namespace LOVE.NET.Data.Models
-{
- using LOVE.NET.Data.Common.Models;
-
- public class Gender : BaseModel
- {
- public string Name { get; set; }
- }
-}
diff --git a/Data/LOVE.NET.Data.Models/Image.cs b/Data/LOVE.NET.Data.Models/Image.cs
deleted file mode 100644
index 330c637..0000000
--- a/Data/LOVE.NET.Data.Models/Image.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-namespace LOVE.NET.Data.Models
-{
- using System.ComponentModel.DataAnnotations;
-
- using LOVE.NET.Data.Common.Models;
-
- public class Image : BaseDeletableModel
- {
- [Required]
- public string Url { get; set; }
-
- public bool IsProfilePicture { get; set; }
-
- public virtual ApplicationUser User { get; set; }
- }
-}
diff --git a/Data/LOVE.NET.Data.Models/LOVE.NET.Data.Models.csproj b/Data/LOVE.NET.Data.Models/LOVE.NET.Data.Models.csproj
deleted file mode 100644
index 6965e05..0000000
--- a/Data/LOVE.NET.Data.Models/LOVE.NET.Data.Models.csproj
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
- net8.0
- latest
-
-
-
- ..\..\Rules.ruleset
-
-
-
-
-
-
-
-
- runtime; build; native; contentfiles; analyzers
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Data/LOVE.NET.Data.Models/Like.cs b/Data/LOVE.NET.Data.Models/Like.cs
deleted file mode 100644
index 2fa220f..0000000
--- a/Data/LOVE.NET.Data.Models/Like.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-namespace LOVE.NET.Data.Models
-{
- using System;
- using System.ComponentModel.DataAnnotations.Schema;
-
- using LOVE.NET.Data.Common.Models;
-
- public class Like : BaseDeletableModel
- {
- public Like()
- {
- this.Id = Guid.NewGuid().ToString();
- }
-
- public string UserId { get; set; }
-
- [ForeignKey(nameof(UserId))]
- public virtual ApplicationUser User { get; set; }
-
- public string LikedUserId { get; set; }
-
- [ForeignKey(nameof(LikedUserId))]
- public virtual ApplicationUser LikedUser { get; set; }
- }
-}
diff --git a/Data/LOVE.NET.Data.Models/Message.cs b/Data/LOVE.NET.Data.Models/Message.cs
deleted file mode 100644
index d780159..0000000
--- a/Data/LOVE.NET.Data.Models/Message.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-namespace LOVE.NET.Data.Models
-{
- using System;
-
- using LOVE.NET.Data.Common.Models;
-
- public class Message : BaseModel
- {
- public Message()
- {
- this.Id = Guid.NewGuid().ToString();
- }
-
- public string RoomId { get; set; }
-
- public string UserId { get; set; }
-
- public ApplicationUser User { get; set; }
-
- public string? Text { get; set; }
-
- public string? ImageUrl { get; set; }
- }
-}
diff --git a/Data/LOVE.NET.Data.Models/RefreshToken.cs b/Data/LOVE.NET.Data.Models/RefreshToken.cs
deleted file mode 100644
index 329431e..0000000
--- a/Data/LOVE.NET.Data.Models/RefreshToken.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-namespace LOVE.NET.Data.Models
-{
- using System;
- using System.Text.Json.Serialization;
-
- public class RefreshToken
- {
- [JsonIgnore]
- public int Id { get; set; }
-
- public string Token { get; set; }
-
- public DateTime Expires { get; set; }
-
- public bool IsExpired => DateTime.UtcNow >= this.Expires;
-
- public DateTime? Revoked { get; set; }
-
- public bool IsActive => this.Revoked == null && !this.IsExpired;
-
- public DateTime CreatedOn { get; set; }
-
- public string ReplacedByToken { get; set; }
- }
-}
diff --git a/Data/LOVE.NET.Data.Models/UserConnection.cs b/Data/LOVE.NET.Data.Models/UserConnection.cs
deleted file mode 100644
index 32d7639..0000000
--- a/Data/LOVE.NET.Data.Models/UserConnection.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-namespace LOVE.NET.Data.Models
-{
- public class UserConnection
- {
- public string UserId { get; set; }
-
- public string RoomId { get; set; }
-
- public string ProfilePictureUrl { get; set; }
-
- public string UserName { get; set; }
- }
-}
diff --git a/Data/LOVE.NET.Data/ApplicationDbContext.cs b/Data/LOVE.NET.Data/ApplicationDbContext.cs
deleted file mode 100644
index 5131075..0000000
--- a/Data/LOVE.NET.Data/ApplicationDbContext.cs
+++ /dev/null
@@ -1,123 +0,0 @@
-namespace LOVE.NET.Data
-{
- using System;
- using System.Linq;
- using System.Reflection;
- using System.Threading;
- using System.Threading.Tasks;
-
- using LOVE.NET.Data.Common.Models;
- using LOVE.NET.Data.Models;
-
- using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
- using Microsoft.EntityFrameworkCore;
-
- public class ApplicationDbContext : IdentityDbContext
- {
- private static readonly MethodInfo SetIsDeletedQueryFilterMethod =
- typeof(ApplicationDbContext).GetMethod(
- nameof(SetIsDeletedQueryFilter),
- BindingFlags.NonPublic | BindingFlags.Static);
-
- public ApplicationDbContext(DbContextOptions options)
- : base(options)
- {
- }
-
- public DbSet Countries { get; set; }
-
- public DbSet Images { get; set; }
-
- public DbSet Likes { get; set; }
-
- public DbSet Cities { get; set; }
-
- public DbSet Genders { get; set; }
-
- public DbSet RefreshTokens { get; set; }
-
- public DbSet Messages { get; set; }
-
- public DbSet Chatrooms { get; set; }
-
- public override int SaveChanges() => this.SaveChanges(true);
-
- public override int SaveChanges(bool acceptAllChangesOnSuccess)
- {
- this.ApplyAuditInfoRules();
- return base.SaveChanges(acceptAllChangesOnSuccess);
- }
-
- public override Task SaveChangesAsync(CancellationToken cancellationToken = default) =>
- this.SaveChangesAsync(true, cancellationToken);
-
- public override Task SaveChangesAsync(
- bool acceptAllChangesOnSuccess,
- CancellationToken cancellationToken = default)
- {
- this.ApplyAuditInfoRules();
- return base.SaveChangesAsync(acceptAllChangesOnSuccess, cancellationToken);
- }
-
- protected override void OnModelCreating(ModelBuilder builder)
- {
- // Needed for Identity models configuration
- base.OnModelCreating(builder);
-
- this.ConfigureUserIdentityRelations(builder);
-
- EntityIndexesConfiguration.Configure(builder);
-
- var entityTypes = builder.Model.GetEntityTypes().ToList();
-
- // Set global query filter for not deleted entities only
- var deletableEntityTypes = entityTypes
- .Where(et => et.ClrType != null && typeof(IDeletableEntity).IsAssignableFrom(et.ClrType));
- foreach (var deletableEntityType in deletableEntityTypes)
- {
- var method = SetIsDeletedQueryFilterMethod.MakeGenericMethod(deletableEntityType.ClrType);
- method.Invoke(null, new object[] { builder });
- }
-
- // Disable cascade delete
- var foreignKeys = entityTypes
- .SelectMany(e => e.GetForeignKeys().Where(f => f.DeleteBehavior == DeleteBehavior.Cascade));
- foreach (var foreignKey in foreignKeys)
- {
- foreignKey.DeleteBehavior = DeleteBehavior.Restrict;
- }
- }
-
- private static void SetIsDeletedQueryFilter(ModelBuilder builder)
- where T : class, IDeletableEntity
- {
- builder.Entity().HasQueryFilter(e => !e.IsDeleted);
- }
-
- // Applies configurations
- private void ConfigureUserIdentityRelations(ModelBuilder builder)
- => builder.ApplyConfigurationsFromAssembly(this.GetType().Assembly);
-
- private void ApplyAuditInfoRules()
- {
- var changedEntries = this.ChangeTracker
- .Entries()
- .Where(e =>
- e.Entity is IAuditInfo &&
- (e.State == EntityState.Added || e.State == EntityState.Modified));
-
- foreach (var entry in changedEntries)
- {
- var entity = (IAuditInfo)entry.Entity;
- if (entry.State == EntityState.Added && entity.CreatedOn == default)
- {
- entity.CreatedOn = DateTime.UtcNow;
- }
- else
- {
- entity.ModifiedOn = DateTime.UtcNow;
- }
- }
- }
- }
-}
diff --git a/Data/LOVE.NET.Data/Configurations/ApplicationUserConfiguration.cs b/Data/LOVE.NET.Data/Configurations/ApplicationUserConfiguration.cs
deleted file mode 100644
index 54125b3..0000000
--- a/Data/LOVE.NET.Data/Configurations/ApplicationUserConfiguration.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-namespace LOVE.NET.Data.Configurations
-{
- using LOVE.NET.Data.Models;
-
- using Microsoft.EntityFrameworkCore;
- using Microsoft.EntityFrameworkCore.Metadata.Builders;
-
- public class ApplicationUserConfiguration : IEntityTypeConfiguration
- {
- public void Configure(EntityTypeBuilder appUser)
- {
- appUser
- .HasMany(e => e.Claims)
- .WithOne()
- .HasForeignKey(e => e.UserId)
- .IsRequired()
- .OnDelete(DeleteBehavior.Restrict);
-
- appUser
- .HasMany(e => e.Logins)
- .WithOne()
- .HasForeignKey(e => e.UserId)
- .IsRequired()
- .OnDelete(DeleteBehavior.Restrict);
-
- appUser
- .HasMany(e => e.Roles)
- .WithOne()
- .HasForeignKey(e => e.UserId)
- .IsRequired()
- .OnDelete(DeleteBehavior.Restrict);
- }
- }
-}
diff --git a/Data/LOVE.NET.Data/DbQueryRunner.cs b/Data/LOVE.NET.Data/DbQueryRunner.cs
deleted file mode 100644
index 662d79b..0000000
--- a/Data/LOVE.NET.Data/DbQueryRunner.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-namespace LOVE.NET.Data
-{
- using System;
- using System.Threading.Tasks;
-
- using LOVE.NET.Data.Common;
-
- using Microsoft.EntityFrameworkCore;
-
- public class DbQueryRunner : IDbQueryRunner
- {
- public DbQueryRunner(ApplicationDbContext context)
- {
- this.Context = context ?? throw new ArgumentNullException(nameof(context));
- }
-
- public ApplicationDbContext Context { get; set; }
-
- public Task RunQueryAsync(string query, params object[] parameters)
- {
- return this.Context.Database.ExecuteSqlRawAsync(query, parameters);
- }
-
- public void Dispose()
- {
- this.Dispose(true);
- GC.SuppressFinalize(this);
- }
-
- protected virtual void Dispose(bool disposing)
- {
- if (disposing)
- {
- this.Context?.Dispose();
- }
- }
- }
-}
diff --git a/Data/LOVE.NET.Data/DesignTimeDbContextFactory.cs b/Data/LOVE.NET.Data/DesignTimeDbContextFactory.cs
deleted file mode 100644
index bb5bd9d..0000000
--- a/Data/LOVE.NET.Data/DesignTimeDbContextFactory.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-namespace LOVE.NET.Data
-{
- using System.IO;
-
- using Microsoft.EntityFrameworkCore;
- using Microsoft.EntityFrameworkCore.Design;
- using Microsoft.Extensions.Configuration;
-
- public class DesignTimeDbContextFactory : IDesignTimeDbContextFactory
- {
- public ApplicationDbContext CreateDbContext(string[] args)
- {
- var configuration = new ConfigurationBuilder()
- .SetBasePath(Directory.GetCurrentDirectory())
- .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
- .Build();
-
- var builder = new DbContextOptionsBuilder();
- var connectionString = configuration.GetConnectionString("DefaultConnection");
- builder.UseSqlServer(connectionString);
-
- return new ApplicationDbContext(builder.Options);
- }
- }
-}
diff --git a/Data/LOVE.NET.Data/EntityIndexesConfiguration.cs b/Data/LOVE.NET.Data/EntityIndexesConfiguration.cs
deleted file mode 100644
index 8fd99d2..0000000
--- a/Data/LOVE.NET.Data/EntityIndexesConfiguration.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-namespace LOVE.NET.Data
-{
- using System.Linq;
-
- using LOVE.NET.Data.Common.Models;
-
- using Microsoft.EntityFrameworkCore;
-
- internal static class EntityIndexesConfiguration
- {
- public static void Configure(ModelBuilder modelBuilder)
- {
- // IDeletableEntity.IsDeleted index
- var deletableEntityTypes = modelBuilder.Model
- .GetEntityTypes()
- .Where(et => et.ClrType != null && typeof(IDeletableEntity).IsAssignableFrom(et.ClrType));
- foreach (var deletableEntityType in deletableEntityTypes)
- {
- modelBuilder.Entity(deletableEntityType.ClrType).HasIndex(nameof(IDeletableEntity.IsDeleted));
- }
- }
- }
-}
diff --git a/Data/LOVE.NET.Data/IdentityOptionsProvider.cs b/Data/LOVE.NET.Data/IdentityOptionsProvider.cs
deleted file mode 100644
index dbe75db..0000000
--- a/Data/LOVE.NET.Data/IdentityOptionsProvider.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-namespace LOVE.NET.Data
-{
- using Microsoft.AspNetCore.Identity;
-
- public static class IdentityOptionsProvider
- {
- public static void GetIdentityOptions(IdentityOptions options)
- {
- options.Password.RequireDigit = false;
- options.Password.RequiredLength = 5;
- options.Password.RequireUppercase = false;
- options.Password.RequireNonAlphanumeric = false;
- options.Password.RequiredUniqueChars = 0;
- options.User.AllowedUserNameCharacters += " ";
- options.SignIn.RequireConfirmedEmail = false; // true
- }
- }
-}
diff --git a/Data/LOVE.NET.Data/LOVE.NET.Data.csproj b/Data/LOVE.NET.Data/LOVE.NET.Data.csproj
deleted file mode 100644
index ab84901..0000000
--- a/Data/LOVE.NET.Data/LOVE.NET.Data.csproj
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
- net8.0
- true
- latest
-
-
-
- ..\..\Rules.ruleset
-
-
-
-
-
-
-
-
- PreserveNewest
- Always
-
-
-
-
-
-
-
- all
- runtime; build; native; contentfiles; analyzers; buildtransitive
-
-
-
- all
- runtime; build; native; contentfiles; analyzers
-
-
-
-
- runtime; build; native; contentfiles; analyzers
-
-
-
-
-
-
-
-
-
-
-
- Always
-
-
- Always
-
-
- Always
-
-
-
-
\ No newline at end of file
diff --git a/Data/LOVE.NET.Data/Migrations/20220607060115_InitialCreate.Designer.cs b/Data/LOVE.NET.Data/Migrations/20220607060115_InitialCreate.Designer.cs
deleted file mode 100644
index fe77370..0000000
--- a/Data/LOVE.NET.Data/Migrations/20220607060115_InitialCreate.Designer.cs
+++ /dev/null
@@ -1,348 +0,0 @@
-//
-using System;
-using LOVE.NET.Data;
-using Microsoft.EntityFrameworkCore;
-using Microsoft.EntityFrameworkCore.Infrastructure;
-using Microsoft.EntityFrameworkCore.Metadata;
-using Microsoft.EntityFrameworkCore.Migrations;
-using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
-
-#nullable disable
-
-namespace LOVE.NET.Data.Migrations
-{
- [DbContext(typeof(ApplicationDbContext))]
- [Migration("20220607060115_InitialCreate")]
- partial class InitialCreate
- {
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "6.0.5")
- .HasAnnotation("Relational:MaxIdentifierLength", 128);
-
- SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1);
-
- modelBuilder.Entity("LOVE.NET.Data.Models.ApplicationRole", b =>
- {
- b.Property("Id")
- .HasColumnType("nvarchar(450)");
-
- b.Property("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("nvarchar(max)");
-
- b.Property("CreatedOn")
- .HasColumnType("datetime2");
-
- b.Property("DeletedOn")
- .HasColumnType("datetime2");
-
- b.Property("IsDeleted")
- .HasColumnType("bit");
-
- b.Property("ModifiedOn")
- .HasColumnType("datetime2");
-
- b.Property("Name")
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)");
-
- b.Property("NormalizedName")
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)");
-
- b.HasKey("Id");
-
- b.HasIndex("IsDeleted");
-
- b.HasIndex("NormalizedName")
- .IsUnique()
- .HasDatabaseName("RoleNameIndex")
- .HasFilter("[NormalizedName] IS NOT NULL");
-
- b.ToTable("AspNetRoles", (string)null);
- });
-
- modelBuilder.Entity("LOVE.NET.Data.Models.ApplicationUser", b =>
- {
- b.Property("Id")
- .HasColumnType("nvarchar(450)");
-
- b.Property("AccessFailedCount")
- .HasColumnType("int");
-
- b.Property("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("nvarchar(max)");
-
- b.Property("CreatedOn")
- .HasColumnType("datetime2");
-
- b.Property("DeletedOn")
- .HasColumnType("datetime2");
-
- b.Property("Email")
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)");
-
- b.Property("EmailConfirmed")
- .HasColumnType("bit");
-
- b.Property("IsDeleted")
- .HasColumnType("bit");
-
- b.Property("LockoutEnabled")
- .HasColumnType("bit");
-
- b.Property("LockoutEnd")
- .HasColumnType("datetimeoffset");
-
- b.Property("ModifiedOn")
- .HasColumnType("datetime2");
-
- b.Property("NormalizedEmail")
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)");
-
- b.Property("NormalizedUserName")
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)");
-
- b.Property("PasswordHash")
- .HasColumnType("nvarchar(max)");
-
- b.Property("PhoneNumber")
- .HasColumnType("nvarchar(max)");
-
- b.Property("PhoneNumberConfirmed")
- .HasColumnType("bit");
-
- b.Property("SecurityStamp")
- .HasColumnType("nvarchar(max)");
-
- b.Property("TwoFactorEnabled")
- .HasColumnType("bit");
-
- b.Property("UserName")
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)");
-
- b.HasKey("Id");
-
- b.HasIndex("IsDeleted");
-
- b.HasIndex("NormalizedEmail")
- .HasDatabaseName("EmailIndex");
-
- b.HasIndex("NormalizedUserName")
- .IsUnique()
- .HasDatabaseName("UserNameIndex")
- .HasFilter("[NormalizedUserName] IS NOT NULL");
-
- b.ToTable("AspNetUsers", (string)null);
- });
-
- modelBuilder.Entity("LOVE.NET.Data.Models.Setting", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("int");
-
- SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1);
-
- b.Property("CreatedOn")
- .HasColumnType("datetime2");
-
- b.Property("DeletedOn")
- .HasColumnType("datetime2");
-
- b.Property("IsDeleted")
- .HasColumnType("bit");
-
- b.Property("ModifiedOn")
- .HasColumnType("datetime2");
-
- b.Property("Name")
- .HasColumnType("nvarchar(max)");
-
- b.Property("Value")
- .HasColumnType("nvarchar(max)");
-
- b.HasKey("Id");
-
- b.HasIndex("IsDeleted");
-
- b.ToTable("Settings");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("int");
-
- SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1);
-
- b.Property("ClaimType")
- .HasColumnType("nvarchar(max)");
-
- b.Property("ClaimValue")
- .HasColumnType("nvarchar(max)");
-
- b.Property("RoleId")
- .IsRequired()
- .HasColumnType("nvarchar(450)");
-
- b.HasKey("Id");
-
- b.HasIndex("RoleId");
-
- b.ToTable("AspNetRoleClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("int");
-
- SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1);
-
- b.Property("ClaimType")
- .HasColumnType("nvarchar(max)");
-
- b.Property("ClaimValue")
- .HasColumnType("nvarchar(max)");
-
- b.Property("UserId")
- .IsRequired()
- .HasColumnType("nvarchar(450)");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("AspNetUserClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b =>
- {
- b.Property("LoginProvider")
- .HasColumnType("nvarchar(450)");
-
- b.Property("ProviderKey")
- .HasColumnType("nvarchar(450)");
-
- b.Property("ProviderDisplayName")
- .HasColumnType("nvarchar(max)");
-
- b.Property("UserId")
- .IsRequired()
- .HasColumnType("nvarchar(450)");
-
- b.HasKey("LoginProvider", "ProviderKey");
-
- b.HasIndex("UserId");
-
- b.ToTable("AspNetUserLogins", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b =>
- {
- b.Property("UserId")
- .HasColumnType("nvarchar(450)");
-
- b.Property("RoleId")
- .HasColumnType("nvarchar(450)");
-
- b.HasKey("UserId", "RoleId");
-
- b.HasIndex("RoleId");
-
- b.ToTable("AspNetUserRoles", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b =>
- {
- b.Property("UserId")
- .HasColumnType("nvarchar(450)");
-
- b.Property("LoginProvider")
- .HasColumnType("nvarchar(450)");
-
- b.Property("Name")
- .HasColumnType("nvarchar(450)");
-
- b.Property("Value")
- .HasColumnType("nvarchar(max)");
-
- b.HasKey("UserId", "LoginProvider", "Name");
-
- b.ToTable("AspNetUserTokens", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b =>
- {
- b.HasOne("LOVE.NET.Data.Models.ApplicationRole", null)
- .WithMany()
- .HasForeignKey("RoleId")
- .OnDelete(DeleteBehavior.Restrict)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b =>
- {
- b.HasOne("LOVE.NET.Data.Models.ApplicationUser", null)
- .WithMany("Claims")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Restrict)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b =>
- {
- b.HasOne("LOVE.NET.Data.Models.ApplicationUser", null)
- .WithMany("Logins")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Restrict)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b =>
- {
- b.HasOne("LOVE.NET.Data.Models.ApplicationRole", null)
- .WithMany()
- .HasForeignKey("RoleId")
- .OnDelete(DeleteBehavior.Restrict)
- .IsRequired();
-
- b.HasOne("LOVE.NET.Data.Models.ApplicationUser", null)
- .WithMany("Roles")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Restrict)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b =>
- {
- b.HasOne("LOVE.NET.Data.Models.ApplicationUser", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Restrict)
- .IsRequired();
- });
-
- modelBuilder.Entity("LOVE.NET.Data.Models.ApplicationUser", b =>
- {
- b.Navigation("Claims");
-
- b.Navigation("Logins");
-
- b.Navigation("Roles");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/Data/LOVE.NET.Data/Migrations/20220607060115_InitialCreate.cs b/Data/LOVE.NET.Data/Migrations/20220607060115_InitialCreate.cs
deleted file mode 100644
index 4c863f5..0000000
--- a/Data/LOVE.NET.Data/Migrations/20220607060115_InitialCreate.cs
+++ /dev/null
@@ -1,266 +0,0 @@
-#nullable disable
-
-namespace LOVE.NET.Data.Migrations
-{
- using System;
-
- using Microsoft.EntityFrameworkCore.Migrations;
-
- public partial class InitialCreate : Migration
- {
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.CreateTable(
- name: "AspNetRoles",
- columns: table => new
- {
- Id = table.Column(type: "nvarchar(450)", nullable: false),
- CreatedOn = table.Column(type: "datetime2", nullable: false),
- ModifiedOn = table.Column(type: "datetime2", nullable: true),
- IsDeleted = table.Column(type: "bit", nullable: false),
- DeletedOn = table.Column(type: "datetime2", nullable: true),
- Name = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true),
- NormalizedName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true),
- ConcurrencyStamp = table.Column(type: "nvarchar(max)", nullable: true),
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_AspNetRoles", x => x.Id);
- });
-
- migrationBuilder.CreateTable(
- name: "AspNetUsers",
- columns: table => new
- {
- Id = table.Column(type: "nvarchar(450)", nullable: false),
- CreatedOn = table.Column(type: "datetime2", nullable: false),
- ModifiedOn = table.Column(type: "datetime2", nullable: true),
- IsDeleted = table.Column(type: "bit", nullable: false),
- DeletedOn = table.Column(type: "datetime2", nullable: true),
- UserName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true),
- NormalizedUserName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true),
- Email = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true),
- NormalizedEmail = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true),
- EmailConfirmed = table.Column(type: "bit", nullable: false),
- PasswordHash = table.Column(type: "nvarchar(max)", nullable: true),
- SecurityStamp = table.Column(type: "nvarchar(max)", nullable: true),
- ConcurrencyStamp = table.Column(type: "nvarchar(max)", nullable: true),
- PhoneNumber = table.Column(type: "nvarchar(max)", nullable: true),
- PhoneNumberConfirmed = table.Column(type: "bit", nullable: false),
- TwoFactorEnabled = table.Column(type: "bit", nullable: false),
- LockoutEnd = table.Column(type: "datetimeoffset", nullable: true),
- LockoutEnabled = table.Column(type: "bit", nullable: false),
- AccessFailedCount = table.Column(type: "int", nullable: false),
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_AspNetUsers", x => x.Id);
- });
-
- migrationBuilder.CreateTable(
- name: "Settings",
- columns: table => new
- {
- Id = table.Column(type: "int", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- Name = table.Column(type: "nvarchar(max)", nullable: true),
- Value = table.Column(type: "nvarchar(max)", nullable: true),
- CreatedOn = table.Column(type: "datetime2", nullable: false),
- ModifiedOn = table.Column(type: "datetime2", nullable: true),
- IsDeleted = table.Column(type: "bit", nullable: false),
- DeletedOn = table.Column(type: "datetime2", nullable: true),
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Settings", x => x.Id);
- });
-
- migrationBuilder.CreateTable(
- name: "AspNetRoleClaims",
- columns: table => new
- {
- Id = table.Column(type: "int", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- RoleId = table.Column(type: "nvarchar(450)", nullable: false),
- ClaimType = table.Column(type: "nvarchar(max)", nullable: true),
- ClaimValue = table.Column(type: "nvarchar(max)", nullable: true),
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_AspNetRoleClaims", x => x.Id);
- table.ForeignKey(
- name: "FK_AspNetRoleClaims_AspNetRoles_RoleId",
- column: x => x.RoleId,
- principalTable: "AspNetRoles",
- principalColumn: "Id",
- onDelete: ReferentialAction.Restrict);
- });
-
- migrationBuilder.CreateTable(
- name: "AspNetUserClaims",
- columns: table => new
- {
- Id = table.Column(type: "int", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- UserId = table.Column(type: "nvarchar(450)", nullable: false),
- ClaimType = table.Column(type: "nvarchar(max)", nullable: true),
- ClaimValue = table.Column(type: "nvarchar(max)", nullable: true),
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_AspNetUserClaims", x => x.Id);
- table.ForeignKey(
- name: "FK_AspNetUserClaims_AspNetUsers_UserId",
- column: x => x.UserId,
- principalTable: "AspNetUsers",
- principalColumn: "Id",
- onDelete: ReferentialAction.Restrict);
- });
-
- migrationBuilder.CreateTable(
- name: "AspNetUserLogins",
- columns: table => new
- {
- LoginProvider = table.Column(type: "nvarchar(450)", nullable: false),
- ProviderKey = table.Column(type: "nvarchar(450)", nullable: false),
- ProviderDisplayName = table.Column(type: "nvarchar(max)", nullable: true),
- UserId = table.Column(type: "nvarchar(450)", nullable: false),
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_AspNetUserLogins", x => new { x.LoginProvider, x.ProviderKey });
- table.ForeignKey(
- name: "FK_AspNetUserLogins_AspNetUsers_UserId",
- column: x => x.UserId,
- principalTable: "AspNetUsers",
- principalColumn: "Id",
- onDelete: ReferentialAction.Restrict);
- });
-
- migrationBuilder.CreateTable(
- name: "AspNetUserRoles",
- columns: table => new
- {
- UserId = table.Column(type: "nvarchar(450)", nullable: false),
- RoleId = table.Column(type: "nvarchar(450)", nullable: false),
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_AspNetUserRoles", x => new { x.UserId, x.RoleId });
- table.ForeignKey(
- name: "FK_AspNetUserRoles_AspNetRoles_RoleId",
- column: x => x.RoleId,
- principalTable: "AspNetRoles",
- principalColumn: "Id",
- onDelete: ReferentialAction.Restrict);
- table.ForeignKey(
- name: "FK_AspNetUserRoles_AspNetUsers_UserId",
- column: x => x.UserId,
- principalTable: "AspNetUsers",
- principalColumn: "Id",
- onDelete: ReferentialAction.Restrict);
- });
-
- migrationBuilder.CreateTable(
- name: "AspNetUserTokens",
- columns: table => new
- {
- UserId = table.Column(type: "nvarchar(450)", nullable: false),
- LoginProvider = table.Column(type: "nvarchar(450)", nullable: false),
- Name = table.Column(type: "nvarchar(450)", nullable: false),
- Value = table.Column(type: "nvarchar(max)", nullable: true),
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_AspNetUserTokens", x => new { x.UserId, x.LoginProvider, x.Name });
- table.ForeignKey(
- name: "FK_AspNetUserTokens_AspNetUsers_UserId",
- column: x => x.UserId,
- principalTable: "AspNetUsers",
- principalColumn: "Id",
- onDelete: ReferentialAction.Restrict);
- });
-
- migrationBuilder.CreateIndex(
- name: "IX_AspNetRoleClaims_RoleId",
- table: "AspNetRoleClaims",
- column: "RoleId");
-
- migrationBuilder.CreateIndex(
- name: "IX_AspNetRoles_IsDeleted",
- table: "AspNetRoles",
- column: "IsDeleted");
-
- migrationBuilder.CreateIndex(
- name: "RoleNameIndex",
- table: "AspNetRoles",
- column: "NormalizedName",
- unique: true,
- filter: "[NormalizedName] IS NOT NULL");
-
- migrationBuilder.CreateIndex(
- name: "IX_AspNetUserClaims_UserId",
- table: "AspNetUserClaims",
- column: "UserId");
-
- migrationBuilder.CreateIndex(
- name: "IX_AspNetUserLogins_UserId",
- table: "AspNetUserLogins",
- column: "UserId");
-
- migrationBuilder.CreateIndex(
- name: "IX_AspNetUserRoles_RoleId",
- table: "AspNetUserRoles",
- column: "RoleId");
-
- migrationBuilder.CreateIndex(
- name: "EmailIndex",
- table: "AspNetUsers",
- column: "NormalizedEmail");
-
- migrationBuilder.CreateIndex(
- name: "IX_AspNetUsers_IsDeleted",
- table: "AspNetUsers",
- column: "IsDeleted");
-
- migrationBuilder.CreateIndex(
- name: "UserNameIndex",
- table: "AspNetUsers",
- column: "NormalizedUserName",
- unique: true,
- filter: "[NormalizedUserName] IS NOT NULL");
-
- migrationBuilder.CreateIndex(
- name: "IX_Settings_IsDeleted",
- table: "Settings",
- column: "IsDeleted");
- }
-
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropTable(
- name: "AspNetRoleClaims");
-
- migrationBuilder.DropTable(
- name: "AspNetUserClaims");
-
- migrationBuilder.DropTable(
- name: "AspNetUserLogins");
-
- migrationBuilder.DropTable(
- name: "AspNetUserRoles");
-
- migrationBuilder.DropTable(
- name: "AspNetUserTokens");
-
- migrationBuilder.DropTable(
- name: "Settings");
-
- migrationBuilder.DropTable(
- name: "AspNetRoles");
-
- migrationBuilder.DropTable(
- name: "AspNetUsers");
- }
- }
-}
diff --git a/Data/LOVE.NET.Data/Migrations/20220816183517_CountriesAndCities.Designer.cs b/Data/LOVE.NET.Data/Migrations/20220816183517_CountriesAndCities.Designer.cs
deleted file mode 100644
index cb1aecc..0000000
--- a/Data/LOVE.NET.Data/Migrations/20220816183517_CountriesAndCities.Designer.cs
+++ /dev/null
@@ -1,424 +0,0 @@
-//
-using System;
-using LOVE.NET.Data;
-using Microsoft.EntityFrameworkCore;
-using Microsoft.EntityFrameworkCore.Infrastructure;
-using Microsoft.EntityFrameworkCore.Metadata;
-using Microsoft.EntityFrameworkCore.Migrations;
-using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
-
-#nullable disable
-
-namespace LOVE.NET.Data.Migrations
-{
- [DbContext(typeof(ApplicationDbContext))]
- [Migration("20220816183517_CountriesAndCities")]
- partial class CountriesAndCities
- {
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "6.0.5")
- .HasAnnotation("Relational:MaxIdentifierLength", 128);
-
- SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1);
-
- modelBuilder.Entity("LOVE.NET.Data.Models.ApplicationRole", b =>
- {
- b.Property("Id")
- .HasColumnType("nvarchar(450)");
-
- b.Property("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("nvarchar(max)");
-
- b.Property("CreatedOn")
- .HasColumnType("datetime2");
-
- b.Property("DeletedOn")
- .HasColumnType("datetime2");
-
- b.Property("IsDeleted")
- .HasColumnType("bit");
-
- b.Property("ModifiedOn")
- .HasColumnType("datetime2");
-
- b.Property("Name")
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)");
-
- b.Property("NormalizedName")
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)");
-
- b.HasKey("Id");
-
- b.HasIndex("IsDeleted");
-
- b.HasIndex("NormalizedName")
- .IsUnique()
- .HasDatabaseName("RoleNameIndex")
- .HasFilter("[NormalizedName] IS NOT NULL");
-
- b.ToTable("AspNetRoles", (string)null);
- });
-
- modelBuilder.Entity("LOVE.NET.Data.Models.ApplicationUser", b =>
- {
- b.Property("Id")
- .HasColumnType("nvarchar(450)");
-
- b.Property("AccessFailedCount")
- .HasColumnType("int");
-
- b.Property("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("nvarchar(max)");
-
- b.Property("CreatedOn")
- .HasColumnType("datetime2");
-
- b.Property("DeletedOn")
- .HasColumnType("datetime2");
-
- b.Property("Email")
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)");
-
- b.Property("EmailConfirmed")
- .HasColumnType("bit");
-
- b.Property("IsDeleted")
- .HasColumnType("bit");
-
- b.Property("LockoutEnabled")
- .HasColumnType("bit");
-
- b.Property("LockoutEnd")
- .HasColumnType("datetimeoffset");
-
- b.Property("ModifiedOn")
- .HasColumnType("datetime2");
-
- b.Property("NormalizedEmail")
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)");
-
- b.Property("NormalizedUserName")
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)");
-
- b.Property("PasswordHash")
- .HasColumnType("nvarchar(max)");
-
- b.Property("PhoneNumber")
- .HasColumnType("nvarchar(max)");
-
- b.Property("PhoneNumberConfirmed")
- .HasColumnType("bit");
-
- b.Property("SecurityStamp")
- .HasColumnType("nvarchar(max)");
-
- b.Property("TwoFactorEnabled")
- .HasColumnType("bit");
-
- b.Property("UserName")
- .HasMaxLength(256)
- .HasColumnType("nvarchar(256)");
-
- b.HasKey("Id");
-
- b.HasIndex("IsDeleted");
-
- b.HasIndex("NormalizedEmail")
- .HasDatabaseName("EmailIndex");
-
- b.HasIndex("NormalizedUserName")
- .IsUnique()
- .HasDatabaseName("UserNameIndex")
- .HasFilter("[NormalizedUserName] IS NOT NULL");
-
- b.ToTable("AspNetUsers", (string)null);
- });
-
- modelBuilder.Entity("LOVE.NET.Data.Models.City", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("int");
-
- SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1);
-
- b.Property("CountryId")
- .HasColumnType("int");
-
- b.Property("CreatedOn")
- .HasColumnType("datetime2");
-
- b.Property("Latitude")
- .HasColumnType("float");
-
- b.Property("Longitude")
- .HasColumnType("float");
-
- b.Property("ModifiedOn")
- .HasColumnType("datetime2");
-
- b.Property("Name")
- .IsRequired()
- .HasColumnType("nvarchar(max)");
-
- b.Property("NameAscii")
- .IsRequired()
- .HasColumnType("nvarchar(max)");
-
- b.HasKey("Id");
-
- b.HasIndex("CountryId");
-
- b.ToTable("Cities");
- });
-
- modelBuilder.Entity("LOVE.NET.Data.Models.Country", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("int");
-
- SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1);
-
- b.Property("CreatedOn")
- .HasColumnType("datetime2");
-
- b.Property("ModifiedOn")
- .HasColumnType("datetime2");
-
- b.Property("Name")
- .HasColumnType("nvarchar(max)");
-
- b.HasKey("Id");
-
- b.ToTable("Countries");
- });
-
- modelBuilder.Entity("LOVE.NET.Data.Models.Setting", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("int");
-
- SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1);
-
- b.Property("CreatedOn")
- .HasColumnType("datetime2");
-
- b.Property("DeletedOn")
- .HasColumnType("datetime2");
-
- b.Property("IsDeleted")
- .HasColumnType("bit");
-
- b.Property("ModifiedOn")
- .HasColumnType("datetime2");
-
- b.Property("Name")
- .HasColumnType("nvarchar(max)");
-
- b.Property("Value")
- .HasColumnType("nvarchar(max)");
-
- b.HasKey("Id");
-
- b.HasIndex("IsDeleted");
-
- b.ToTable("Settings");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("int");
-
- SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1);
-
- b.Property("ClaimType")
- .HasColumnType("nvarchar(max)");
-
- b.Property("ClaimValue")
- .HasColumnType("nvarchar(max)");
-
- b.Property("RoleId")
- .IsRequired()
- .HasColumnType("nvarchar(450)");
-
- b.HasKey("Id");
-
- b.HasIndex("RoleId");
-
- b.ToTable("AspNetRoleClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd()
- .HasColumnType("int");
-
- SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1);
-
- b.Property("ClaimType")
- .HasColumnType("nvarchar(max)");
-
- b.Property("ClaimValue")
- .HasColumnType("nvarchar(max)");
-
- b.Property("UserId")
- .IsRequired()
- .HasColumnType("nvarchar(450)");
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("AspNetUserClaims", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b =>
- {
- b.Property("LoginProvider")
- .HasColumnType("nvarchar(450)");
-
- b.Property("ProviderKey")
- .HasColumnType("nvarchar(450)");
-
- b.Property("ProviderDisplayName")
- .HasColumnType("nvarchar(max)");
-
- b.Property("UserId")
- .IsRequired()
- .HasColumnType("nvarchar(450)");
-
- b.HasKey("LoginProvider", "ProviderKey");
-
- b.HasIndex("UserId");
-
- b.ToTable("AspNetUserLogins", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b =>
- {
- b.Property("UserId")
- .HasColumnType("nvarchar(450)");
-
- b.Property("RoleId")
- .HasColumnType("nvarchar(450)");
-
- b.HasKey("UserId", "RoleId");
-
- b.HasIndex("RoleId");
-
- b.ToTable("AspNetUserRoles", (string)null);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b =>
- {
- b.Property("UserId")
- .HasColumnType("nvarchar(450)");
-
- b.Property("LoginProvider")
- .HasColumnType("nvarchar(450)");
-
- b.Property("Name")
- .HasColumnType("nvarchar(450)");
-
- b.Property("Value")
- .HasColumnType("nvarchar(max)");
-
- b.HasKey("UserId", "LoginProvider", "Name");
-
- b.ToTable("AspNetUserTokens", (string)null);
- });
-
- modelBuilder.Entity("LOVE.NET.Data.Models.City", b =>
- {
- b.HasOne("LOVE.NET.Data.Models.Country", "Country")
- .WithMany("Cities")
- .HasForeignKey("CountryId")
- .OnDelete(DeleteBehavior.Restrict)
- .IsRequired();
-
- b.Navigation("Country");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b =>
- {
- b.HasOne("LOVE.NET.Data.Models.ApplicationRole", null)
- .WithMany()
- .HasForeignKey("RoleId")
- .OnDelete(DeleteBehavior.Restrict)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b =>
- {
- b.HasOne("LOVE.NET.Data.Models.ApplicationUser", null)
- .WithMany("Claims")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Restrict)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b =>
- {
- b.HasOne("LOVE.NET.Data.Models.ApplicationUser", null)
- .WithMany("Logins")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Restrict)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b =>
- {
- b.HasOne("LOVE.NET.Data.Models.ApplicationRole", null)
- .WithMany()
- .HasForeignKey("RoleId")
- .OnDelete(DeleteBehavior.Restrict)
- .IsRequired();
-
- b.HasOne("LOVE.NET.Data.Models.ApplicationUser", null)
- .WithMany("Roles")
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Restrict)
- .IsRequired();
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b =>
- {
- b.HasOne("LOVE.NET.Data.Models.ApplicationUser", null)
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Restrict)
- .IsRequired();
- });
-
- modelBuilder.Entity("LOVE.NET.Data.Models.ApplicationUser", b =>
- {
- b.Navigation("Claims");
-
- b.Navigation("Logins");
-
- b.Navigation("Roles");
- });
-
- modelBuilder.Entity("LOVE.NET.Data.Models.Country", b =>
- {
- b.Navigation("Cities");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/Data/LOVE.NET.Data/Migrations/20220816183517_CountriesAndCities.cs b/Data/LOVE.NET.Data/Migrations/20220816183517_CountriesAndCities.cs
deleted file mode 100644
index 55ba4d3..0000000
--- a/Data/LOVE.NET.Data/Migrations/20220816183517_CountriesAndCities.cs
+++ /dev/null
@@ -1,67 +0,0 @@
-using System;
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace LOVE.NET.Data.Migrations
-{
- public partial class CountriesAndCities : Migration
- {
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.CreateTable(
- name: "Countries",
- columns: table => new
- {
- Id = table.Column