referans tablosu üretildi. Türü ve Kodu için kontrol sağlandı.

This commit is contained in:
2025-08-10 17:21:52 +03:00
parent 2ab4d14a58
commit ab7878a43b
5 changed files with 356 additions and 0 deletions

View File

@@ -17,6 +17,21 @@ namespace DugunSalonu.Models
public DbSet<Ilce> ilce { get; set; }
public DbSet<Referans> referans { get; set; }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<Referans>()
.HasIndex(r => new { r.turu, r.kodu })
.IsUnique();
// kts alanı için default değer
modelBuilder.Entity<Referans>()
.Property(r => r.kts)
.HasDefaultValueSql("NOW()");
}
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseNpgsql("Server=edoysoft.com;Database=DugunSalonu;User Id=postgres;Password=MgC1453MgC;", b => b.EnableRetryOnFailure());