initial commit

This commit is contained in:
2026-08-09 12:22:40 +02:00
parent a36b2fa801
commit d6dbc1881a
44 changed files with 5787 additions and 1 deletions
+28
View File
@@ -0,0 +1,28 @@
using FocusApp.Models;
using Microsoft.EntityFrameworkCore;
namespace FocusApp.Data;
public class FocusContext : DbContext
{
public DbSet<FocusTask> FocusTasks { get; set; }
public FocusContext(DbContextOptions<FocusContext> options) : base(options)
{
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.Entity<FocusTask>(entity =>
{
entity.HasKey(e => e.Id);
entity.Property(e => e.Title).IsRequired().HasMaxLength(255);
entity.Property(e => e.Description).HasMaxLength(2000);
entity.Property(e => e.Order).IsRequired();
entity.Property(e => e.CreatedAt).IsRequired();
entity.Property(e => e.UpdatedAt).IsRequired();
});
}
}