Compare commits
4 Commits
ab7878a43b
...
5c7bb2c399
Author | SHA1 | Date | |
---|---|---|---|
5c7bb2c399 | |||
5616230e67 | |||
b6d91c88fe | |||
3f7be79bcf |
210
Migrations/20250811081119_mig10.Designer.cs
generated
Normal file
210
Migrations/20250811081119_mig10.Designer.cs
generated
Normal file
@@ -0,0 +1,210 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using DugunSalonu.Models;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace DugunSalonu.Migrations
|
||||
{
|
||||
[DbContext(typeof(dugunsalonuContext))]
|
||||
[Migration("20250811081119_mig10")]
|
||||
partial class mig10
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "9.0.7")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||
|
||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("DugunSalonu.Models.Il", b =>
|
||||
{
|
||||
b.Property<int>("id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("id"));
|
||||
|
||||
b.Property<string>("adi")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.ToTable("il");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DugunSalonu.Models.Ilce", b =>
|
||||
{
|
||||
b.Property<int>("id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("id"));
|
||||
|
||||
b.Property<int>("ILid")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("ilid");
|
||||
|
||||
b.Property<string>("adi")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("character varying(50)");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.ToTable("ilce");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DugunSalonu.Models.Kullanici", b =>
|
||||
{
|
||||
b.Property<int>("id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("id"));
|
||||
|
||||
b.Property<string>("adi")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("character varying(50)");
|
||||
|
||||
b.Property<bool>("admin")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("aktif")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<string>("ceptel")
|
||||
.HasMaxLength(10)
|
||||
.HasColumnType("character varying(10)");
|
||||
|
||||
b.Property<string>("eposta")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("character varying(50)");
|
||||
|
||||
b.Property<string>("kullaniciadi")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("character varying(50)");
|
||||
|
||||
b.Property<string>("parola")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("soyadi")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("character varying(50)");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.ToTable("kullanici");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DugunSalonu.Models.Referans", b =>
|
||||
{
|
||||
b.Property<string>("adi")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("character varying(50)");
|
||||
|
||||
b.Property<bool>("aktif")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<int>("id")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("kk")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("kodu")
|
||||
.IsRequired()
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("character varying(20)");
|
||||
|
||||
b.Property<DateTime>("kts")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("turu")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("character varying(50)");
|
||||
|
||||
b.HasIndex("turu", "kodu")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("referans");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DugunSalonu.Models.Salon", b =>
|
||||
{
|
||||
b.Property<int>("id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("id"));
|
||||
|
||||
b.Property<string>("CepTel")
|
||||
.IsRequired()
|
||||
.HasMaxLength(10)
|
||||
.HasColumnType("character varying(10)");
|
||||
|
||||
b.Property<string>("adi")
|
||||
.IsRequired()
|
||||
.HasMaxLength(150)
|
||||
.HasColumnType("character varying(150)");
|
||||
|
||||
b.Property<string>("adres")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("character varying(250)");
|
||||
|
||||
b.Property<string>("eposta")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int?>("ilceid")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int?>("ilid")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("telefon")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("vergidairesi")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("verginumarasi")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("webadres")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("ilid");
|
||||
|
||||
b.ToTable("salon");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DugunSalonu.Models.Salon", b =>
|
||||
{
|
||||
b.HasOne("DugunSalonu.Models.Il", "il")
|
||||
.WithMany()
|
||||
.HasForeignKey("ilid");
|
||||
|
||||
b.Navigation("il");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
65
Migrations/20250811081119_mig10.cs
Normal file
65
Migrations/20250811081119_mig10.cs
Normal file
@@ -0,0 +1,65 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace DugunSalonu.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class mig10 : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropPrimaryKey(
|
||||
name: "PK_referans",
|
||||
table: "referans");
|
||||
|
||||
migrationBuilder.AlterColumn<DateTime>(
|
||||
name: "kts",
|
||||
table: "referans",
|
||||
type: "timestamp with time zone",
|
||||
nullable: false,
|
||||
oldClrType: typeof(DateTime),
|
||||
oldType: "timestamp with time zone",
|
||||
oldDefaultValueSql: "NOW()");
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "id",
|
||||
table: "referans",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "integer")
|
||||
.OldAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<DateTime>(
|
||||
name: "kts",
|
||||
table: "referans",
|
||||
type: "timestamp with time zone",
|
||||
nullable: false,
|
||||
defaultValueSql: "NOW()",
|
||||
oldClrType: typeof(DateTime),
|
||||
oldType: "timestamp with time zone");
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "id",
|
||||
table: "referans",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "integer")
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
migrationBuilder.AddPrimaryKey(
|
||||
name: "PK_referans",
|
||||
table: "referans",
|
||||
column: "id");
|
||||
}
|
||||
}
|
||||
}
|
230
Migrations/20250811082022_mig11.Designer.cs
generated
Normal file
230
Migrations/20250811082022_mig11.Designer.cs
generated
Normal file
@@ -0,0 +1,230 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using DugunSalonu.Models;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace DugunSalonu.Migrations
|
||||
{
|
||||
[DbContext(typeof(dugunsalonuContext))]
|
||||
[Migration("20250811082022_mig11")]
|
||||
partial class mig11
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "9.0.7")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||
|
||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("DugunSalonu.Models.Il", b =>
|
||||
{
|
||||
b.Property<int>("id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("id"));
|
||||
|
||||
b.Property<string>("adi")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.ToTable("il");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DugunSalonu.Models.Ilce", b =>
|
||||
{
|
||||
b.Property<int>("id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("id"));
|
||||
|
||||
b.Property<int>("ILid")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("ilid");
|
||||
|
||||
b.Property<string>("adi")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("character varying(50)");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("ILid");
|
||||
|
||||
b.ToTable("ilce");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DugunSalonu.Models.Kullanici", b =>
|
||||
{
|
||||
b.Property<int>("id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("id"));
|
||||
|
||||
b.Property<string>("adi")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("character varying(50)");
|
||||
|
||||
b.Property<bool>("admin")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("aktif")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<string>("ceptel")
|
||||
.HasMaxLength(10)
|
||||
.HasColumnType("character varying(10)");
|
||||
|
||||
b.Property<string>("eposta")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("character varying(50)");
|
||||
|
||||
b.Property<string>("kullaniciadi")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("character varying(50)");
|
||||
|
||||
b.Property<string>("parola")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("soyadi")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("character varying(50)");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.ToTable("kullanici");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DugunSalonu.Models.Referans", b =>
|
||||
{
|
||||
b.Property<string>("adi")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("character varying(50)");
|
||||
|
||||
b.Property<bool>("aktif")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<int>("id")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("kk")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("kodu")
|
||||
.IsRequired()
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("character varying(20)");
|
||||
|
||||
b.Property<DateTime>("kts")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("turu")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("character varying(50)");
|
||||
|
||||
b.HasIndex("turu", "kodu")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("referans");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DugunSalonu.Models.Salon", b =>
|
||||
{
|
||||
b.Property<int>("id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("id"));
|
||||
|
||||
b.Property<string>("CepTel")
|
||||
.IsRequired()
|
||||
.HasMaxLength(10)
|
||||
.HasColumnType("character varying(10)");
|
||||
|
||||
b.Property<string>("adi")
|
||||
.IsRequired()
|
||||
.HasMaxLength(150)
|
||||
.HasColumnType("character varying(150)");
|
||||
|
||||
b.Property<string>("adres")
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("character varying(250)");
|
||||
|
||||
b.Property<string>("eposta")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int?>("ilceid")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int?>("ilid")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("telefon")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("vergidairesi")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("verginumarasi")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("webadres")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("ilid");
|
||||
|
||||
b.ToTable("salon");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DugunSalonu.Models.Ilce", b =>
|
||||
{
|
||||
b.HasOne("DugunSalonu.Models.Il", "Il")
|
||||
.WithMany("ilceler")
|
||||
.HasForeignKey("ILid")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Il");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DugunSalonu.Models.Salon", b =>
|
||||
{
|
||||
b.HasOne("DugunSalonu.Models.Il", "il")
|
||||
.WithMany("salons")
|
||||
.HasForeignKey("ilid");
|
||||
|
||||
b.Navigation("il");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DugunSalonu.Models.Il", b =>
|
||||
{
|
||||
b.Navigation("ilceler");
|
||||
|
||||
b.Navigation("salons");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
39
Migrations/20250811082022_mig11.cs
Normal file
39
Migrations/20250811082022_mig11.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace DugunSalonu.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class mig11 : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ilce_ilid",
|
||||
table: "ilce",
|
||||
column: "ilid");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_ilce_il_ilid",
|
||||
table: "ilce",
|
||||
column: "ilid",
|
||||
principalTable: "il",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_ilce_il_ilid",
|
||||
table: "ilce");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_ilce_ilid",
|
||||
table: "ilce");
|
||||
}
|
||||
}
|
||||
}
|
@@ -47,16 +47,19 @@ namespace DugunSalonu.Migrations
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("id"));
|
||||
|
||||
b.Property<int>("ILid")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("ilid");
|
||||
|
||||
b.Property<string>("adi")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("character varying(50)");
|
||||
|
||||
b.Property<int>("ilid")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("ILid");
|
||||
|
||||
b.ToTable("ilce");
|
||||
});
|
||||
|
||||
@@ -108,12 +111,6 @@ namespace DugunSalonu.Migrations
|
||||
|
||||
modelBuilder.Entity("DugunSalonu.Models.Referans", b =>
|
||||
{
|
||||
b.Property<int>("id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("id"));
|
||||
|
||||
b.Property<string>("adi")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
@@ -122,6 +119,9 @@ namespace DugunSalonu.Migrations
|
||||
b.Property<bool>("aktif")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<int>("id")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("kk")
|
||||
.HasColumnType("integer");
|
||||
|
||||
@@ -131,17 +131,13 @@ namespace DugunSalonu.Migrations
|
||||
.HasColumnType("character varying(20)");
|
||||
|
||||
b.Property<DateTime>("kts")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("timestamp with time zone")
|
||||
.HasDefaultValueSql("NOW()");
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("turu")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("character varying(50)");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("turu", "kodu")
|
||||
.IsUnique();
|
||||
|
||||
@@ -199,14 +195,32 @@ namespace DugunSalonu.Migrations
|
||||
b.ToTable("salon");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DugunSalonu.Models.Ilce", b =>
|
||||
{
|
||||
b.HasOne("DugunSalonu.Models.Il", "Il")
|
||||
.WithMany("ilceler")
|
||||
.HasForeignKey("ILid")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Il");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DugunSalonu.Models.Salon", b =>
|
||||
{
|
||||
b.HasOne("DugunSalonu.Models.Il", "il")
|
||||
.WithMany()
|
||||
.WithMany("salons")
|
||||
.HasForeignKey("ilid");
|
||||
|
||||
b.Navigation("il");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DugunSalonu.Models.Il", b =>
|
||||
{
|
||||
b.Navigation("ilceler");
|
||||
|
||||
b.Navigation("salons");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
|
@@ -16,6 +16,7 @@ namespace DugunSalonu.Models
|
||||
public int id { get; set; }
|
||||
public string adi { get; set; }
|
||||
|
||||
ICollection<Salon>? salons { get; set; }
|
||||
public ICollection<Salon>? salons { get; set; }
|
||||
public ICollection<Ilce>? ilceler { get; set; }
|
||||
}
|
||||
}
|
||||
|
@@ -1,18 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DugunSalonu.Models
|
||||
{
|
||||
internal class Ilce
|
||||
[Table("ilce")]
|
||||
public class Ilce
|
||||
{
|
||||
public Ilce()
|
||||
{
|
||||
il = new HashSet<Salon>();
|
||||
}
|
||||
|
||||
[Key]
|
||||
public int id { get; set; }
|
||||
@@ -20,10 +18,10 @@ namespace DugunSalonu.Models
|
||||
[MaxLength(50)]
|
||||
public required string adi { get; set; }
|
||||
[Required]
|
||||
public required int ilid { get; set; }
|
||||
ICollection<Salon>? il { get; set; }
|
||||
|
||||
ICollection<Salon>? ilce { get; set; }
|
||||
|
||||
[Column("ilid")]
|
||||
public required int ILid { get; set; }
|
||||
Salon? il { get; set; }
|
||||
ICollection<Salon>? salon { get; set; }
|
||||
public Il? Il { get; set; }
|
||||
}
|
||||
}
|
||||
|
@@ -8,7 +8,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace DugunSalonu.Models
|
||||
{
|
||||
internal class Kullanici
|
||||
public class Kullanici
|
||||
{
|
||||
[Key]
|
||||
public int id { get; set; }
|
||||
|
@@ -24,7 +24,7 @@ namespace DugunSalonu.Models
|
||||
[MaxLength(50)]
|
||||
public required string adi { get; set; }
|
||||
[Required]
|
||||
public required DateTime kts { get; set; }
|
||||
public required DateTime kts { get; set; } = DateTime.UtcNow;
|
||||
[Required]
|
||||
public required int kk { get; set; }
|
||||
|
||||
|
@@ -8,7 +8,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace DugunSalonu.Models
|
||||
{
|
||||
internal class dugunsalonuContext:DbContext
|
||||
public class dugunsalonuContext : DbContext
|
||||
{
|
||||
public DbSet<Kullanici> kullanici { get; set; }
|
||||
|
||||
@@ -26,11 +26,14 @@ namespace DugunSalonu.Models
|
||||
modelBuilder.Entity<Referans>()
|
||||
.HasIndex(r => new { r.turu, r.kodu })
|
||||
.IsUnique();
|
||||
|
||||
modelBuilder.Entity<Referans>().HasNoKey();
|
||||
modelBuilder.Entity<Il>().HasMany<Ilce>(i => i.ilceler);
|
||||
modelBuilder.Entity<Ilce>().HasOne<Il>(i => i.Il);
|
||||
/*
|
||||
// kts alanı için default değer
|
||||
modelBuilder.Entity<Referans>()
|
||||
.Property(r => r.kts)
|
||||
.HasDefaultValueSql("NOW()");
|
||||
.HasDefaultValueSql("NOW()");*/
|
||||
}
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
@@ -38,22 +41,6 @@ namespace DugunSalonu.Models
|
||||
base.OnConfiguring(optionsBuilder);
|
||||
}
|
||||
|
||||
/*protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
base.OnModelCreating(modelBuilder);
|
||||
|
||||
foreach (var entityType in modelBuilder.Model.GetEntityTypes())
|
||||
{
|
||||
// Sütun isimlerini büyük harfe dönüştür
|
||||
foreach (var property in entityType.GetProperties())
|
||||
{
|
||||
var columnName = property.GetColumnName(StoreObjectIdentifier.Table(entityType.GetTableName(), entityType.GetSchema()));
|
||||
// property.SetColumnName(Encoding.ASCII.GetString(columnName.ToLower()));
|
||||
}
|
||||
|
||||
// İsteğe bağlı: Tablo isimlerini de büyük harfe dönüştür (eğer istiyorsanız)
|
||||
entityType.SetTableName(entityType.GetTableName().ToLower());
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user