Moved features to a specific folder

This commit is contained in:
Jonathan Bourdon
2024-07-18 22:22:44 -04:00
parent 98c85265f1
commit b34a775a4b
23 changed files with 32 additions and 37 deletions

View File

@@ -0,0 +1,12 @@
namespace Hutopy.Web.Features.Contents.Data;
public class Content
{
public Guid Id { get; init; }
public Guid CreatedBy { get; init; }
public DateTimeOffset CreatedAt { get; }
public string? Title { get; init; }
public string? Description { get; init; }
public string? Uri { get; init; }
}

View File

@@ -0,0 +1,21 @@
using Microsoft.EntityFrameworkCore;
namespace Hutopy.Web.Features.Contents.Data;
public class ContentDbContext(
DbContextOptions<ContentDbContext> options)
: DbContext(options)
{
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.HasDefaultSchema("Content");
modelBuilder
.Entity<Content>()
.Property(c => c.CreatedAt)
.ValueGeneratedOnAdd()
.HasDefaultValueSql("CURRENT_TIMESTAMP");
}
public DbSet<Content> Contents { get; set; }
}