Removed seperate plugins project since you're always referencing both..

Added more loading logic
This commit is contained in:
SpoinkyNL committed 2018-04-06 19:54:25 +02:00
1 parent b80e1ea528
commit 9a2ea0c2b3
57 files changed
+959 -650

No files matched your search

+3 -2
View File
@@ -8,8 +8,9 @@
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="2.0.1" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="2.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="2.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.0.2" />
</ItemGroup>
<ItemGroup>
<Folder Include="Migrations\" />
+2 -2
View File
@@ -5,10 +5,10 @@ using System.ComponentModel.DataAnnotations.Schema;
namespace Artemis.Storage.Entities
{
[Table("Folders")]
internal class FolderEntity
public class FolderEntity
{
[Key]
public int Id { get; set; }
public string Guid { get; set; }
public int Order { get; set; }
public string Name { get; set; }
@@ -4,10 +4,10 @@ using System.ComponentModel.DataAnnotations.Schema;
namespace Artemis.Storage.Entities
{
[Table("Keypoints")]
internal class KeypointEntity
public class KeypointEntity
{
[Key]
public int Id { get; set; }
public string Guid { get; set; }
public int Time { get; set; }
public string Value { get; set; }
+2 -4
View File
@@ -5,12 +5,10 @@ using System.ComponentModel.DataAnnotations.Schema;
namespace Artemis.Storage.Entities
{
[Table("Layers")]
internal class LayerEntity
public class LayerEntity
{
[Key]
public int Id { get; set; }
public string Type { get; set; }
public string Guid { get; set; }
public virtual ICollection<LedEntity> Leds { get; set; }
public virtual ICollection<LayerSettingEntity> Settings { get; set; }
@@ -5,10 +5,10 @@ using System.ComponentModel.DataAnnotations.Schema;
namespace Artemis.Storage.Entities
{
[Table("LayerSettings")]
internal class LayerSettingEntity
public class LayerSettingEntity
{
[Key]
public int Id { get; set; }
public string Guid { get; set; }
public string Name { get; set; }
public string Value { get; set; }
+2 -2
View File
@@ -4,10 +4,10 @@ using System.ComponentModel.DataAnnotations.Schema;
namespace Artemis.Storage.Entities
{
[Table("Leds")]
internal class LedEntity
public class LedEntity
{
[Key]
public int Id { get; set; }
public string Guid { get; set; }
public string LedName { get; set; }
public string LimitedToDevice { get; set; }
@@ -1,14 +1,16 @@
using System.ComponentModel.DataAnnotations;
using System;
using System.ComponentModel.DataAnnotations;
namespace Artemis.Storage.Entities
{
internal class ProfileEntity
public class ProfileEntity
{
[Key]
public int Id { get; set; }
public string Guid { get; set; }
public Guid PluginGuid { get; set; }
public string Name { get; set; }
public string Module { get; set; }
public int RootFolderId { get; set; }
public virtual FolderEntity RootFolder { get; set; }
@@ -2,7 +2,7 @@
namespace Artemis.Storage.Entities
{
internal class SettingEntity
public class SettingEntity
{
[Key]
public string Name { get; set; }
@@ -1,200 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Artemis.Storage.Migrations
{
public partial class InitialCreate : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
"Folders",
table => new
{
Id = table.Column<int>(nullable: false)
.Annotation("Sqlite:Autoincrement", true),
FolderEntityId = table.Column<int>(nullable: true),
Name = table.Column<string>(nullable: true),
Order = table.Column<int>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Folders", x => x.Id);
table.ForeignKey(
"FK_Folders_Folders_FolderEntityId",
x => x.FolderEntityId,
"Folders",
"Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
"Settings",
table => new
{
Name = table.Column<string>(nullable: false),
Value = table.Column<string>(nullable: true)
},
constraints: table => { table.PrimaryKey("PK_Settings", x => x.Name); });
migrationBuilder.CreateTable(
"Layers",
table => new
{
Id = table.Column<int>(nullable: false)
.Annotation("Sqlite:Autoincrement", true),
FolderEntityId = table.Column<int>(nullable: true),
Name = table.Column<string>(nullable: true),
Order = table.Column<int>(nullable: false),
Type = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Layers", x => x.Id);
table.ForeignKey(
"FK_Layers_Folders_FolderEntityId",
x => x.FolderEntityId,
"Folders",
"Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
"Profiles",
table => new
{
Id = table.Column<int>(nullable: false)
.Annotation("Sqlite:Autoincrement", true),
Module = table.Column<string>(nullable: true),
Name = table.Column<string>(nullable: true),
RootFolderId = table.Column<int>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Profiles", x => x.Id);
table.ForeignKey(
"FK_Profiles_Folders_RootFolderId",
x => x.RootFolderId,
"Folders",
"Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
"LayerSettings",
table => new
{
Id = table.Column<int>(nullable: false)
.Annotation("Sqlite:Autoincrement", true),
LayerEntityId = table.Column<int>(nullable: true),
Name = table.Column<string>(nullable: true),
Value = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_LayerSettings", x => x.Id);
table.ForeignKey(
"FK_LayerSettings_Layers_LayerEntityId",
x => x.LayerEntityId,
"Layers",
"Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
"Leds",
table => new
{
Id = table.Column<int>(nullable: false)
.Annotation("Sqlite:Autoincrement", true),
LayerId = table.Column<int>(nullable: false),
LedName = table.Column<string>(nullable: true),
LimitedToDevice = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Leds", x => x.Id);
table.ForeignKey(
"FK_Leds_Layers_LayerId",
x => x.LayerId,
"Layers",
"Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
"Keypoints",
table => new
{
Id = table.Column<int>(nullable: false)
.Annotation("Sqlite:Autoincrement", true),
LayerSettingEntityId = table.Column<int>(nullable: true),
Time = table.Column<int>(nullable: false),
Value = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Keypoints", x => x.Id);
table.ForeignKey(
"FK_Keypoints_LayerSettings_LayerSettingEntityId",
x => x.LayerSettingEntityId,
"LayerSettings",
"Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateIndex(
"IX_Folders_FolderEntityId",
"Folders",
"FolderEntityId");
migrationBuilder.CreateIndex(
"IX_Keypoints_LayerSettingEntityId",
"Keypoints",
"LayerSettingEntityId");
migrationBuilder.CreateIndex(
"IX_Layers_FolderEntityId",
"Layers",
"FolderEntityId");
migrationBuilder.CreateIndex(
"IX_LayerSettings_LayerEntityId",
"LayerSettings",
"LayerEntityId");
migrationBuilder.CreateIndex(
"IX_Leds_LayerId",
"Leds",
"LayerId");
migrationBuilder.CreateIndex(
"IX_Profiles_RootFolderId",
"Profiles",
"RootFolderId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
"Keypoints");
migrationBuilder.DropTable(
"Leds");
migrationBuilder.DropTable(
"Profiles");
migrationBuilder.DropTable(
"Settings");
migrationBuilder.DropTable(
"LayerSettings");
migrationBuilder.DropTable(
"Layers");
migrationBuilder.DropTable(
"Folders");
}
}
}
@@ -5,126 +5,129 @@ using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage;
using Microsoft.EntityFrameworkCore.Storage.Internal;
using System;
namespace Artemis.Storage.Migrations
{
[DbContext(typeof(StorageContext))]
[Migration("20180124134310_InitialCreate")]
[Migration("20180406175247_InitialCreate")]
partial class InitialCreate
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "2.0.1-rtm-125");
.HasAnnotation("ProductVersion", "2.0.2-rtm-10011");
modelBuilder.Entity("Artemis.Storage.Entities.FolderEntity", b =>
{
b.Property<int>("Id")
b.Property<string>("Guid")
.ValueGeneratedOnAdd();
b.Property<int?>("FolderEntityId");
b.Property<string>("FolderEntityGuid");
b.Property<string>("Name");
b.Property<int>("Order");
b.HasKey("Id");
b.HasKey("Guid");
b.HasIndex("FolderEntityId");
b.HasIndex("FolderEntityGuid");
b.ToTable("Folders");
});
modelBuilder.Entity("Artemis.Storage.Entities.KeypointEntity", b =>
{
b.Property<int>("Id")
b.Property<string>("Guid")
.ValueGeneratedOnAdd();
b.Property<int?>("LayerSettingEntityId");
b.Property<string>("LayerSettingEntityGuid");
b.Property<int>("Time");
b.Property<string>("Value");
b.HasKey("Id");
b.HasKey("Guid");
b.HasIndex("LayerSettingEntityId");
b.HasIndex("LayerSettingEntityGuid");
b.ToTable("Keypoints");
});
modelBuilder.Entity("Artemis.Storage.Entities.LayerEntity", b =>
{
b.Property<int>("Id")
b.Property<string>("Guid")
.ValueGeneratedOnAdd();
b.Property<int?>("FolderEntityId");
b.Property<string>("FolderEntityGuid");
b.Property<string>("Name");
b.Property<int>("Order");
b.Property<string>("Type");
b.HasKey("Guid");
b.HasKey("Id");
b.HasIndex("FolderEntityId");
b.HasIndex("FolderEntityGuid");
b.ToTable("Layers");
});
modelBuilder.Entity("Artemis.Storage.Entities.LayerSettingEntity", b =>
{
b.Property<int>("Id")
b.Property<string>("Guid")
.ValueGeneratedOnAdd();
b.Property<int?>("LayerEntityId");
b.Property<string>("LayerEntityGuid");
b.Property<string>("Name");
b.Property<string>("Value");
b.HasKey("Id");
b.HasKey("Guid");
b.HasIndex("LayerEntityId");
b.HasIndex("LayerEntityGuid");
b.ToTable("LayerSettings");
});
modelBuilder.Entity("Artemis.Storage.Entities.LedEntity", b =>
{
b.Property<int>("Id")
b.Property<string>("Guid")
.ValueGeneratedOnAdd();
b.Property<string>("LayerGuid");
b.Property<int>("LayerId");
b.Property<string>("LedName");
b.Property<string>("LimitedToDevice");
b.HasKey("Id");
b.HasKey("Guid");
b.HasIndex("LayerId");
b.HasIndex("LayerGuid");
b.ToTable("Leds");
});
modelBuilder.Entity("Artemis.Storage.Entities.ProfileEntity", b =>
{
b.Property<int>("Id")
b.Property<string>("Guid")
.ValueGeneratedOnAdd();
b.Property<string>("Module");
b.Property<string>("Name");
b.Property<Guid>("PluginGuid");
b.Property<string>("RootFolderGuid");
b.Property<int>("RootFolderId");
b.HasKey("Id");
b.HasKey("Guid");
b.HasIndex("RootFolderId");
b.HasIndex("RootFolderGuid");
b.ToTable("Profiles");
});
@@ -145,44 +148,42 @@ namespace Artemis.Storage.Migrations
{
b.HasOne("Artemis.Storage.Entities.FolderEntity")
.WithMany("Folders")
.HasForeignKey("FolderEntityId");
.HasForeignKey("FolderEntityGuid");
});
modelBuilder.Entity("Artemis.Storage.Entities.KeypointEntity", b =>
{
b.HasOne("Artemis.Storage.Entities.LayerSettingEntity")
.WithMany("Keypoints")
.HasForeignKey("LayerSettingEntityId");
.HasForeignKey("LayerSettingEntityGuid");
});
modelBuilder.Entity("Artemis.Storage.Entities.LayerEntity", b =>
{
b.HasOne("Artemis.Storage.Entities.FolderEntity")
.WithMany("Layers")
.HasForeignKey("FolderEntityId");
.HasForeignKey("FolderEntityGuid");
});
modelBuilder.Entity("Artemis.Storage.Entities.LayerSettingEntity", b =>
{
b.HasOne("Artemis.Storage.Entities.LayerEntity")
.WithMany("Settings")
.HasForeignKey("LayerEntityId");
.HasForeignKey("LayerEntityGuid");
});
modelBuilder.Entity("Artemis.Storage.Entities.LedEntity", b =>
{
b.HasOne("Artemis.Storage.Entities.LayerEntity", "Layer")
.WithMany("Leds")
.HasForeignKey("LayerId")
.OnDelete(DeleteBehavior.Cascade);
.HasForeignKey("LayerGuid");
});
modelBuilder.Entity("Artemis.Storage.Entities.ProfileEntity", b =>
{
b.HasOne("Artemis.Storage.Entities.FolderEntity", "RootFolder")
.WithMany()
.HasForeignKey("RootFolderId")
.OnDelete(DeleteBehavior.Cascade);
.HasForeignKey("RootFolderGuid");
});
#pragma warning restore 612, 618
}
@@ -0,0 +1,200 @@
using Microsoft.EntityFrameworkCore.Migrations;
using System;
using System.Collections.Generic;
namespace Artemis.Storage.Migrations
{
public partial class InitialCreate : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Folders",
columns: table => new
{
Guid = table.Column<string>(nullable: false),
FolderEntityGuid = table.Column<string>(nullable: true),
Name = table.Column<string>(nullable: true),
Order = table.Column<int>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Folders", x => x.Guid);
table.ForeignKey(
name: "FK_Folders_Folders_FolderEntityGuid",
column: x => x.FolderEntityGuid,
principalTable: "Folders",
principalColumn: "Guid",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "Settings",
columns: table => new
{
Name = table.Column<string>(nullable: false),
Value = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Settings", x => x.Name);
});
migrationBuilder.CreateTable(
name: "Layers",
columns: table => new
{
Guid = table.Column<string>(nullable: false),
FolderEntityGuid = table.Column<string>(nullable: true),
Name = table.Column<string>(nullable: true),
Order = table.Column<int>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Layers", x => x.Guid);
table.ForeignKey(
name: "FK_Layers_Folders_FolderEntityGuid",
column: x => x.FolderEntityGuid,
principalTable: "Folders",
principalColumn: "Guid",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "Profiles",
columns: table => new
{
Guid = table.Column<string>(nullable: false),
Name = table.Column<string>(nullable: true),
PluginGuid = table.Column<Guid>(nullable: false),
RootFolderGuid = table.Column<string>(nullable: true),
RootFolderId = table.Column<int>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Profiles", x => x.Guid);
table.ForeignKey(
name: "FK_Profiles_Folders_RootFolderGuid",
column: x => x.RootFolderGuid,
principalTable: "Folders",
principalColumn: "Guid",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "LayerSettings",
columns: table => new
{
Guid = table.Column<string>(nullable: false),
LayerEntityGuid = table.Column<string>(nullable: true),
Name = table.Column<string>(nullable: true),
Value = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_LayerSettings", x => x.Guid);
table.ForeignKey(
name: "FK_LayerSettings_Layers_LayerEntityGuid",
column: x => x.LayerEntityGuid,
principalTable: "Layers",
principalColumn: "Guid",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "Leds",
columns: table => new
{
Guid = table.Column<string>(nullable: false),
LayerGuid = table.Column<string>(nullable: true),
LayerId = table.Column<int>(nullable: false),
LedName = table.Column<string>(nullable: true),
LimitedToDevice = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Leds", x => x.Guid);
table.ForeignKey(
name: "FK_Leds_Layers_LayerGuid",
column: x => x.LayerGuid,
principalTable: "Layers",
principalColumn: "Guid",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "Keypoints",
columns: table => new
{
Guid = table.Column<string>(nullable: false),
LayerSettingEntityGuid = table.Column<string>(nullable: true),
Time = table.Column<int>(nullable: false),
Value = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Keypoints", x => x.Guid);
table.ForeignKey(
name: "FK_Keypoints_LayerSettings_LayerSettingEntityGuid",
column: x => x.LayerSettingEntityGuid,
principalTable: "LayerSettings",
principalColumn: "Guid",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateIndex(
name: "IX_Folders_FolderEntityGuid",
table: "Folders",
column: "FolderEntityGuid");
migrationBuilder.CreateIndex(
name: "IX_Keypoints_LayerSettingEntityGuid",
table: "Keypoints",
column: "LayerSettingEntityGuid");
migrationBuilder.CreateIndex(
name: "IX_Layers_FolderEntityGuid",
table: "Layers",
column: "FolderEntityGuid");
migrationBuilder.CreateIndex(
name: "IX_LayerSettings_LayerEntityGuid",
table: "LayerSettings",
column: "LayerEntityGuid");
migrationBuilder.CreateIndex(
name: "IX_Leds_LayerGuid",
table: "Leds",
column: "LayerGuid");
migrationBuilder.CreateIndex(
name: "IX_Profiles_RootFolderGuid",
table: "Profiles",
column: "RootFolderGuid");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Keypoints");
migrationBuilder.DropTable(
name: "Leds");
migrationBuilder.DropTable(
name: "Profiles");
migrationBuilder.DropTable(
name: "Settings");
migrationBuilder.DropTable(
name: "LayerSettings");
migrationBuilder.DropTable(
name: "Layers");
migrationBuilder.DropTable(
name: "Folders");
}
}
}
@@ -1,185 +1,190 @@
// <auto-generated />
using Artemis.Storage;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage;
using Microsoft.EntityFrameworkCore.Storage.Internal;
using System;
namespace Artemis.Storage.Migrations
{
[DbContext(typeof(StorageContext))]
internal class StorageContextModelSnapshot : ModelSnapshot
partial class StorageContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "2.0.1-rtm-125");
.HasAnnotation("ProductVersion", "2.0.2-rtm-10011");
modelBuilder.Entity("Artemis.Storage.Entities.FolderEntity", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
{
b.Property<string>("Guid")
.ValueGeneratedOnAdd();
b.Property<int?>("FolderEntityId");
b.Property<string>("FolderEntityGuid");
b.Property<string>("Name");
b.Property<string>("Name");
b.Property<int>("Order");
b.Property<int>("Order");
b.HasKey("Id");
b.HasKey("Guid");
b.HasIndex("FolderEntityId");
b.HasIndex("FolderEntityGuid");
b.ToTable("Folders");
});
b.ToTable("Folders");
});
modelBuilder.Entity("Artemis.Storage.Entities.KeypointEntity", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
{
b.Property<string>("Guid")
.ValueGeneratedOnAdd();
b.Property<int?>("LayerSettingEntityId");
b.Property<string>("LayerSettingEntityGuid");
b.Property<int>("Time");
b.Property<int>("Time");
b.Property<string>("Value");
b.Property<string>("Value");
b.HasKey("Id");
b.HasKey("Guid");
b.HasIndex("LayerSettingEntityId");
b.HasIndex("LayerSettingEntityGuid");
b.ToTable("Keypoints");
});
b.ToTable("Keypoints");
});
modelBuilder.Entity("Artemis.Storage.Entities.LayerEntity", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
{
b.Property<string>("Guid")
.ValueGeneratedOnAdd();
b.Property<int?>("FolderEntityId");
b.Property<string>("FolderEntityGuid");
b.Property<string>("Name");
b.Property<string>("Name");
b.Property<int>("Order");
b.Property<int>("Order");
b.Property<string>("Type");
b.HasKey("Guid");
b.HasKey("Id");
b.HasIndex("FolderEntityGuid");
b.HasIndex("FolderEntityId");
b.ToTable("Layers");
});
b.ToTable("Layers");
});
modelBuilder.Entity("Artemis.Storage.Entities.LayerSettingEntity", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
{
b.Property<string>("Guid")
.ValueGeneratedOnAdd();
b.Property<int?>("LayerEntityId");
b.Property<string>("LayerEntityGuid");
b.Property<string>("Name");
b.Property<string>("Name");
b.Property<string>("Value");
b.Property<string>("Value");
b.HasKey("Id");
b.HasKey("Guid");
b.HasIndex("LayerEntityId");
b.HasIndex("LayerEntityGuid");
b.ToTable("LayerSettings");
});
b.ToTable("LayerSettings");
});
modelBuilder.Entity("Artemis.Storage.Entities.LedEntity", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
{
b.Property<string>("Guid")
.ValueGeneratedOnAdd();
b.Property<int>("LayerId");
b.Property<string>("LayerGuid");
b.Property<string>("LedName");
b.Property<int>("LayerId");
b.Property<string>("LimitedToDevice");
b.Property<string>("LedName");
b.HasKey("Id");
b.Property<string>("LimitedToDevice");
b.HasIndex("LayerId");
b.HasKey("Guid");
b.ToTable("Leds");
});
b.HasIndex("LayerGuid");
b.ToTable("Leds");
});
modelBuilder.Entity("Artemis.Storage.Entities.ProfileEntity", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
{
b.Property<string>("Guid")
.ValueGeneratedOnAdd();
b.Property<string>("Module");
b.Property<string>("Name");
b.Property<string>("Name");
b.Property<Guid>("PluginGuid");
b.Property<int>("RootFolderId");
b.Property<string>("RootFolderGuid");
b.HasKey("Id");
b.Property<int>("RootFolderId");
b.HasIndex("RootFolderId");
b.HasKey("Guid");
b.ToTable("Profiles");
});
b.HasIndex("RootFolderGuid");
b.ToTable("Profiles");
});
modelBuilder.Entity("Artemis.Storage.Entities.SettingEntity", b =>
{
b.Property<string>("Name")
.ValueGeneratedOnAdd();
{
b.Property<string>("Name")
.ValueGeneratedOnAdd();
b.Property<string>("Value");
b.Property<string>("Value");
b.HasKey("Name");
b.HasKey("Name");
b.ToTable("Settings");
});
b.ToTable("Settings");
});
modelBuilder.Entity("Artemis.Storage.Entities.FolderEntity", b =>
{
b.HasOne("Artemis.Storage.Entities.FolderEntity")
.WithMany("Folders")
.HasForeignKey("FolderEntityId");
});
{
b.HasOne("Artemis.Storage.Entities.FolderEntity")
.WithMany("Folders")
.HasForeignKey("FolderEntityGuid");
});
modelBuilder.Entity("Artemis.Storage.Entities.KeypointEntity", b =>
{
b.HasOne("Artemis.Storage.Entities.LayerSettingEntity")
.WithMany("Keypoints")
.HasForeignKey("LayerSettingEntityId");
});
{
b.HasOne("Artemis.Storage.Entities.LayerSettingEntity")
.WithMany("Keypoints")
.HasForeignKey("LayerSettingEntityGuid");
});
modelBuilder.Entity("Artemis.Storage.Entities.LayerEntity", b =>
{
b.HasOne("Artemis.Storage.Entities.FolderEntity")
.WithMany("Layers")
.HasForeignKey("FolderEntityId");
});
{
b.HasOne("Artemis.Storage.Entities.FolderEntity")
.WithMany("Layers")
.HasForeignKey("FolderEntityGuid");
});
modelBuilder.Entity("Artemis.Storage.Entities.LayerSettingEntity", b =>
{
b.HasOne("Artemis.Storage.Entities.LayerEntity")
.WithMany("Settings")
.HasForeignKey("LayerEntityId");
});
{
b.HasOne("Artemis.Storage.Entities.LayerEntity")
.WithMany("Settings")
.HasForeignKey("LayerEntityGuid");
});
modelBuilder.Entity("Artemis.Storage.Entities.LedEntity", b =>
{
b.HasOne("Artemis.Storage.Entities.LayerEntity", "Layer")
.WithMany("Leds")
.HasForeignKey("LayerId")
.OnDelete(DeleteBehavior.Cascade);
});
{
b.HasOne("Artemis.Storage.Entities.LayerEntity", "Layer")
.WithMany("Leds")
.HasForeignKey("LayerGuid");
});
modelBuilder.Entity("Artemis.Storage.Entities.ProfileEntity", b =>
{
b.HasOne("Artemis.Storage.Entities.FolderEntity", "RootFolder")
.WithMany()
.HasForeignKey("RootFolderId")
.OnDelete(DeleteBehavior.Cascade);
});
{
b.HasOne("Artemis.Storage.Entities.FolderEntity", "RootFolder")
.WithMany()
.HasForeignKey("RootFolderGuid");
});
#pragma warning restore 612, 618
}
}
}
}
+3 -3
View File
@@ -3,10 +3,10 @@ using Microsoft.EntityFrameworkCore;
namespace Artemis.Storage
{
internal class StorageContext : DbContext
public class StorageContext : DbContext
{
internal DbSet<ProfileEntity> Profiles { get; set; }
internal DbSet<SettingEntity> Settings { get; set; }
public DbSet<ProfileEntity> Profiles { get; set; }
public DbSet<SettingEntity> Settings { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{