proyecto preparado para DDD + CQRS

This commit is contained in:
2025-09-01 23:06:17 +02:00
parent 895e40edc0
commit 09c211a0fe
7 changed files with 92 additions and 12 deletions

View File

@@ -0,0 +1,12 @@
using Microsoft.EntityFrameworkCore;
namespace back.Domain;
public class ApplicationDbContext : DbContext
{
public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options) : base(options)
{
Database.EnsureCreated();
Database.Migrate();
}
}

14
back/Domain/IEntity.cs Normal file
View File

@@ -0,0 +1,14 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace back.Domain;
public interface IEntity
{
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
string Id
{
get;
set;
}
}