// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Model.DAL;

#nullable disable

namespace Model.Migrations
{
    [DbContext(typeof(ZooDBContext))]
    [Migration("20221109131654_TryOneToManyComment")]
    partial class TryOneToManyComment
    {
        /// <inheritdoc />
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
                .HasAnnotation("ProductVersion", "7.0.0")
                .HasAnnotation("Relational:MaxIdentifierLength", 128);

            SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);

            modelBuilder.Entity("Model.Models.Animel", b =>
                {
                    b.Property<Guid>("ID")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uniqueidentifier");

                    b.Property<DateTime>("BirthDate")
                        .HasColumnType("datetime2");

                    b.Property<Guid?>("CategoryID")
                        .IsRequired()
                        .HasColumnType("uniqueidentifier");

                    b.Property<string>("Description")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Image")
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("ID");

                    b.HasIndex("CategoryID");

                    b.ToTable("Animel");

                    b.HasData(
                        new
                        {
                            ID = new Guid("56966718-8663-4d9b-8bb6-05e053e75428"),
                            BirthDate = new DateTime(2002, 6, 12, 0, 0, 0, 0, DateTimeKind.Unspecified),
                            CategoryID = new Guid("37c53437-874d-4714-b7d1-c703043ee1a8"),
                            Description = "",
                            Image = "~/Images/Defult.jpg",
                            Name = "Elephent"
                        },
                        new
                        {
                            ID = new Guid("0a1b87da-cd5a-48b6-bb1f-ffeceaf10b04"),
                            BirthDate = new DateTime(2009, 12, 12, 0, 0, 0, 0, DateTimeKind.Unspecified),
                            CategoryID = new Guid("2873a78e-21dd-4c7d-8aa7-47e1857bf9e0"),
                            Description = "",
                            Image = "~/Images/Defult.jpg",
                            Name = "Eagel"
                        });
                });

            modelBuilder.Entity("Model.Models.Category", b =>
                {
                    b.Property<Guid>("CategoryID")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uniqueidentifier");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("CategoryID");

                    b.ToTable("Category");

                    b.HasData(
                        new
                        {
                            CategoryID = new Guid("37c53437-874d-4714-b7d1-c703043ee1a8"),
                            Name = "Mammal"
                        },
                        new
                        {
                            CategoryID = new Guid("2873a78e-21dd-4c7d-8aa7-47e1857bf9e0"),
                            Name = "Avian"
                        });
                });

            modelBuilder.Entity("Model.Models.Comment", b =>
                {
                    b.Property<Guid>("CommentId")
                        .HasColumnType("uniqueidentifier");

                    b.Property<Guid>("AnimelID")
                        .HasColumnType("uniqueidentifier");

                    b.Property<string>("Content")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("CommentId");

                    b.HasIndex("AnimelID");

                    b.ToTable("Comment");

                    b.HasData(
                        new
                        {
                            CommentId = new Guid("953994f9-295b-47a0-90c4-c2e9fa593833"),
                            AnimelID = new Guid("56966718-8663-4d9b-8bb6-05e053e75428"),
                            Content = "Content"
                        },
                        new
                        {
                            CommentId = new Guid("4b9e2e61-7a83-479a-b55a-c6babb1585c5"),
                            AnimelID = new Guid("0a1b87da-cd5a-48b6-bb1f-ffeceaf10b04"),
                            Content = "Content"
                        });
                });

            modelBuilder.Entity("Model.Models.Animel", b =>
                {
                    b.HasOne("Model.Models.Category", "Category")
                        .WithMany()
                        .HasForeignKey("CategoryID")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Category");
                });

            modelBuilder.Entity("Model.Models.Comment", b =>
                {
                    b.HasOne("Model.Models.Animel", "Animel")
                        .WithMany()
                        .HasForeignKey("AnimelID")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Model.Models.Animel", null)
                        .WithMany("Comments")
                        .HasForeignKey("CommentId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Animel");
                });

            modelBuilder.Entity("Model.Models.Animel", b =>
                {
                    b.Navigation("Comments");
                });
#pragma warning restore 612, 618
        }
    }
}
