Upgraded projects to .NET 9.0 and added new projects `KBR.Cache`, `KBR.Shared`, and `KBR.Shared.Lite` to the solution. Introduced JWT authentication and OTP handling with new models, services, and configuration options. Updated database schema with new entities `Users` and `RefreshTokens`, and added migrations for schema changes. Implemented caching strategies using `AppDistributedCache` with support for in-memory, SQL Server, and Redis. Enhanced email handling with `MailHelpers` for domain replacement. Updated controllers, repositories, and configuration files to support new features.
18 lines
596 B
C#
18 lines
596 B
C#
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
|
|
namespace PortBlog.API.Entities.Mapping
|
|
{
|
|
public class CacheMapping : IEntityTypeConfiguration<Cache>
|
|
{
|
|
public void Configure(EntityTypeBuilder<Cache> builder)
|
|
{
|
|
builder.HasKey(c => c.Id);
|
|
builder.Property(c => c.Id).ValueGeneratedOnAdd();
|
|
builder.Property(c => c.ExpiresAtTime).IsRequired();
|
|
builder.Property(c => c.Id).HasMaxLength(449).IsRequired();
|
|
builder.Property(c => c.Value).IsRequired();
|
|
}
|
|
}
|
|
}
|