v3.0.1
This commit is contained in:
橙子
2021-06-02 20:00:25 +08:00
parent 6ea91cbaf6
commit e5063e1a4d
57 changed files with 1665 additions and 359 deletions

View File

@@ -7,10 +7,9 @@
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="5.0.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="5.0.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="5.0.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.6" />
<PackageReference Include="Oracle.EntityFrameworkCore" Version="5.21.1" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="5.0.0" />
</ItemGroup>
<ItemGroup>

View File

@@ -0,0 +1,36 @@
// <auto-generated />
using CC.Yi.Model;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace CC.Yi.Model.Migrations
{
[DbContext(typeof(DataContext))]
[Migration("20210602114758_yi1")]
partial class yi1
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "5.0.6");
modelBuilder.Entity("CC.Yi.Model.student", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("name")
.HasColumnType("TEXT");
b.HasKey("id");
b.ToTable("student");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,29 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace CC.Yi.Model.Migrations
{
public partial class yi1 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "student",
columns: table => new
{
id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
name = table.Column<string>(type: "TEXT", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_student", x => x.id);
});
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "student");
}
}
}

View File

@@ -0,0 +1,39 @@
// <auto-generated />
using CC.Yi.Model;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace CC.Yi.Model.Migrations
{
[DbContext(typeof(DataContext))]
[Migration("20210602115718_yi2")]
partial class yi2
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "5.0.6");
modelBuilder.Entity("CC.Yi.Model.student", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<int>("is_delete")
.HasColumnType("INTEGER");
b.Property<string>("name")
.HasColumnType("TEXT");
b.HasKey("id");
b.ToTable("student");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,24 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace CC.Yi.Model.Migrations
{
public partial class yi2 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "is_delete",
table: "student",
type: "INTEGER",
nullable: false,
defaultValue: 0);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "is_delete",
table: "student");
}
}
}

View File

@@ -0,0 +1,37 @@
// <auto-generated />
using CC.Yi.Model;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace CC.Yi.Model.Migrations
{
[DbContext(typeof(DataContext))]
partial class DataContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "5.0.6");
modelBuilder.Entity("CC.Yi.Model.student", b =>
{
b.Property<int>("id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<int>("is_delete")
.HasColumnType("INTEGER");
b.Property<string>("name")
.HasColumnType("TEXT");
b.HasKey("id");
b.ToTable("student");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -7,6 +7,5 @@ namespace CC.Yi.Model
public partial class DataContext :DbContext
{
public DbSet<student> student { get; set; }
public DbSet<prop> prop { get; set; }
}
}

View File

@@ -6,12 +6,11 @@ using System.Text;
namespace CC.Yi.Model
{
public class prop
public class baseModel
{
[Key]
[DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
public int id { get; set; }
public string name { get; set; }
public student student { get; set; }
public int is_delete { get; set; }
}
}

View File

@@ -6,12 +6,8 @@ using System.Text;
namespace CC.Yi.Model
{
public class student
public class student:baseModel
{
[Key]
[DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
public int id { get; set; }
public string name { get; set; }
public List<prop> props { get; set; }
}
}