//
using System;
using DatabaseCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace DatabaseCore.Migrations
{
[DbContext(typeof(DatabaseContext))]
partial class DatabaseContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("ProductVersion", "5.0.4")
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("DatabaseCore.Models.Security.Access", b =>
{
b.Property("Id")
.HasColumnType("uniqueidentifier");
b.Property("AccessOperation")
.HasColumnType("int");
b.Property("AccessType")
.HasColumnType("int");
b.Property("DateCreate")
.HasColumnType("datetime2");
b.Property("DateDelete")
.HasColumnType("datetime2");
b.Property("IsDeleted")
.HasColumnType("bit");
b.Property("RoleId")
.HasColumnType("uniqueidentifier");
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("Accesses");
});
modelBuilder.Entity("DatabaseCore.Models.Security.EnviromentSetting", b =>
{
b.Property("Id")
.HasColumnType("uniqueidentifier");
b.Property("Description")
.HasColumnType("nvarchar(max)");
b.Property("Key")
.HasColumnType("nvarchar(max)");
b.Property("Value")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("EnviromentSettings");
});
modelBuilder.Entity("DatabaseCore.Models.Security.Role", b =>
{
b.Property("Id")
.HasColumnType("uniqueidentifier");
b.Property("DateCreate")
.HasColumnType("datetime2");
b.Property("DateDelete")
.HasColumnType("datetime2");
b.Property("IsDeleted")
.HasColumnType("bit");
b.Property("RoleName")
.HasColumnType("nvarchar(max)");
b.Property("RolePriority")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("Roles");
});
modelBuilder.Entity("DatabaseCore.Models.Security.User", b =>
{
b.Property("Id")
.HasColumnType("uniqueidentifier");
b.Property("Avatar")
.HasColumnType("varbinary(max)");
b.Property("CountAttempt")
.HasColumnType("int");
b.Property("DateBanned")
.HasColumnType("datetime2");
b.Property("DateCreate")
.HasColumnType("datetime2");
b.Property("DateDelete")
.HasColumnType("datetime2");
b.Property("DateLastVisit")
.HasColumnType("datetime2");
b.Property("EmployeeId")
.HasColumnType("uniqueidentifier");
b.Property("IsBanned")
.HasColumnType("bit");
b.Property("IsDeleted")
.HasColumnType("bit");
b.Property("LecturerId")
.HasColumnType("uniqueidentifier");
b.Property("PasswordHash")
.HasColumnType("nvarchar(max)");
b.Property("StudentId")
.HasColumnType("uniqueidentifier");
b.Property("UserName")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Users");
});
modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b =>
{
b.Property("Id")
.HasColumnType("uniqueidentifier");
b.Property("DateCreate")
.HasColumnType("datetime2");
b.Property("DateDelete")
.HasColumnType("datetime2");
b.Property("IsDeleted")
.HasColumnType("bit");
b.Property("RoleId")
.HasColumnType("uniqueidentifier");
b.Property("UserId")
.HasColumnType("uniqueidentifier");
b.HasKey("Id");
b.HasIndex("RoleId");
b.HasIndex("UserId");
b.ToTable("UserRoles");
});
modelBuilder.Entity("DatabaseCore.Models.Security.Access", b =>
{
b.HasOne("DatabaseCore.Models.Security.Role", "Role")
.WithMany("Access")
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Role");
});
modelBuilder.Entity("DatabaseCore.Models.Security.UserRole", b =>
{
b.HasOne("DatabaseCore.Models.Security.Role", "Role")
.WithMany("UserRoles")
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("DatabaseCore.Models.Security.User", "User")
.WithMany("UserRoles")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Role");
b.Navigation("User");
});
modelBuilder.Entity("DatabaseCore.Models.Security.Role", b =>
{
b.Navigation("Access");
b.Navigation("UserRoles");
});
modelBuilder.Entity("DatabaseCore.Models.Security.User", b =>
{
b.Navigation("UserRoles");
});
#pragma warning restore 612, 618
}
}
}