[CHANGE] Remove anon accounts && added simple caching for urls
This commit is contained in:
25
Manager.Data/Contexts/CacheDbContext.cs
Normal file
25
Manager.Data/Contexts/CacheDbContext.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using Manager.Data.Entities.Cache;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Manager.Data.Contexts;
|
||||
|
||||
public sealed class CacheDbContext : DbContext
|
||||
{
|
||||
public CacheDbContext(DbContextOptions<CacheDbContext> options) : base(options)
|
||||
{
|
||||
Database.EnsureCreated();
|
||||
}
|
||||
|
||||
public DbSet<CacheEntity> Cache { get; set; }
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder.Entity<CacheEntity>(ce =>
|
||||
{
|
||||
ce.ToTable("cache");
|
||||
ce.HasKey(x => x.Id);
|
||||
});
|
||||
|
||||
base.OnModelCreating(modelBuilder);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user