Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e1ec15d03e | ||
|
|
df7f01938f |
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
||||
</startup>
|
||||
</configuration>
|
||||
@@ -0,0 +1,89 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{9590B32F-4C69-48FA-AD0F-E482FB4728AB}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<RootNamespace>DatabaseViewer</RootNamespace>
|
||||
<AssemblyName>DatabaseViewer</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<Deterministic>true</Deterministic>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="MainViewerForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="MainViewerForm.Designer.cs">
|
||||
<DependentUpon>MainViewerForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<EmbeddedResource Include="MainViewerForm.resx">
|
||||
<DependentUpon>MainViewerForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Pf2eDataScrapper\Pf2eDataScrapper.csproj">
|
||||
<Project>{ff82896a-92ca-4c63-8fdc-959ecc513773}</Project>
|
||||
<Name>Pf2eDataScrapper</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
+140
@@ -0,0 +1,140 @@
|
||||
namespace DatabaseViewer
|
||||
{
|
||||
partial class MainViewerForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Обязательная переменная конструктора.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Освободить все используемые ресурсы.
|
||||
/// </summary>
|
||||
/// <param name="disposing">истинно, если управляемый ресурс должен быть удален; иначе ложно.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Код, автоматически созданный конструктором форм Windows
|
||||
|
||||
/// <summary>
|
||||
/// Требуемый метод для поддержки конструктора — не изменяйте
|
||||
/// содержимое этого метода с помощью редактора кода.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.RootSplitContainer = new System.Windows.Forms.SplitContainer();
|
||||
this.InnerSplitContainer = new System.Windows.Forms.SplitContainer();
|
||||
this.EntityDataGridView = new System.Windows.Forms.DataGridView();
|
||||
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
|
||||
this.TypeListBox = new System.Windows.Forms.ListBox();
|
||||
((System.ComponentModel.ISupportInitialize)(this.RootSplitContainer)).BeginInit();
|
||||
this.RootSplitContainer.Panel1.SuspendLayout();
|
||||
this.RootSplitContainer.Panel2.SuspendLayout();
|
||||
this.RootSplitContainer.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.InnerSplitContainer)).BeginInit();
|
||||
this.InnerSplitContainer.Panel1.SuspendLayout();
|
||||
this.InnerSplitContainer.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.EntityDataGridView)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// RootSplitContainer
|
||||
//
|
||||
this.RootSplitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.RootSplitContainer.Location = new System.Drawing.Point(0, 24);
|
||||
this.RootSplitContainer.Name = "RootSplitContainer";
|
||||
//
|
||||
// RootSplitContainer.Panel1
|
||||
//
|
||||
this.RootSplitContainer.Panel1.Controls.Add(this.TypeListBox);
|
||||
this.RootSplitContainer.Panel1MinSize = 200;
|
||||
//
|
||||
// RootSplitContainer.Panel2
|
||||
//
|
||||
this.RootSplitContainer.Panel2.Controls.Add(this.InnerSplitContainer);
|
||||
this.RootSplitContainer.Panel2MinSize = 400;
|
||||
this.RootSplitContainer.Size = new System.Drawing.Size(984, 687);
|
||||
this.RootSplitContainer.SplitterDistance = 200;
|
||||
this.RootSplitContainer.TabIndex = 0;
|
||||
//
|
||||
// InnerSplitContainer
|
||||
//
|
||||
this.InnerSplitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.InnerSplitContainer.Location = new System.Drawing.Point(0, 0);
|
||||
this.InnerSplitContainer.Name = "InnerSplitContainer";
|
||||
this.InnerSplitContainer.Orientation = System.Windows.Forms.Orientation.Horizontal;
|
||||
//
|
||||
// InnerSplitContainer.Panel1
|
||||
//
|
||||
this.InnerSplitContainer.Panel1.Controls.Add(this.EntityDataGridView);
|
||||
this.InnerSplitContainer.Size = new System.Drawing.Size(780, 687);
|
||||
this.InnerSplitContainer.SplitterDistance = 328;
|
||||
this.InnerSplitContainer.TabIndex = 0;
|
||||
//
|
||||
// EntityDataGridView
|
||||
//
|
||||
this.EntityDataGridView.AllowUserToAddRows = false;
|
||||
this.EntityDataGridView.AllowUserToDeleteRows = false;
|
||||
this.EntityDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.EntityDataGridView.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.EntityDataGridView.Location = new System.Drawing.Point(0, 0);
|
||||
this.EntityDataGridView.Name = "EntityDataGridView";
|
||||
this.EntityDataGridView.ReadOnly = true;
|
||||
this.EntityDataGridView.Size = new System.Drawing.Size(780, 328);
|
||||
this.EntityDataGridView.TabIndex = 0;
|
||||
//
|
||||
// menuStrip1
|
||||
//
|
||||
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
|
||||
this.menuStrip1.Name = "menuStrip1";
|
||||
this.menuStrip1.Size = new System.Drawing.Size(984, 24);
|
||||
this.menuStrip1.TabIndex = 1;
|
||||
this.menuStrip1.Text = "menuStrip1";
|
||||
//
|
||||
// TypeListBox
|
||||
//
|
||||
this.TypeListBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.TypeListBox.FormattingEnabled = true;
|
||||
this.TypeListBox.Location = new System.Drawing.Point(0, 0);
|
||||
this.TypeListBox.Name = "TypeListBox";
|
||||
this.TypeListBox.Size = new System.Drawing.Size(200, 687);
|
||||
this.TypeListBox.TabIndex = 0;
|
||||
//
|
||||
// MainViewerForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(984, 711);
|
||||
this.Controls.Add(this.RootSplitContainer);
|
||||
this.Controls.Add(this.menuStrip1);
|
||||
this.MainMenuStrip = this.menuStrip1;
|
||||
this.Name = "MainViewerForm";
|
||||
this.Text = "Form1";
|
||||
this.RootSplitContainer.Panel1.ResumeLayout(false);
|
||||
this.RootSplitContainer.Panel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.RootSplitContainer)).EndInit();
|
||||
this.RootSplitContainer.ResumeLayout(false);
|
||||
this.InnerSplitContainer.Panel1.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.InnerSplitContainer)).EndInit();
|
||||
this.InnerSplitContainer.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.EntityDataGridView)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.SplitContainer RootSplitContainer;
|
||||
private System.Windows.Forms.SplitContainer InnerSplitContainer;
|
||||
private System.Windows.Forms.DataGridView EntityDataGridView;
|
||||
private System.Windows.Forms.MenuStrip menuStrip1;
|
||||
private System.Windows.Forms.ListBox TypeListBox;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Pf2eDataScrapper.Model;
|
||||
|
||||
namespace DatabaseViewer
|
||||
{
|
||||
public partial class MainViewerForm : Form
|
||||
{
|
||||
public Pf2eDbContext Context;
|
||||
|
||||
public MainViewerForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace DatabaseViewer
|
||||
{
|
||||
internal static class Program
|
||||
{
|
||||
/// <summary>
|
||||
/// Главная точка входа для приложения.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Application.Run(new MainViewerForm());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// Общие сведения об этой сборке предоставляются следующим набором
|
||||
// набора атрибутов. Измените значения этих атрибутов для изменения сведений,
|
||||
// связанных со сборкой.
|
||||
[assembly: AssemblyTitle("DatabaseViewer")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("DatabaseViewer")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2025")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Установка значения False для параметра ComVisible делает типы в этой сборке невидимыми
|
||||
// для компонентов COM. Если необходимо обратиться к типу в этой сборке через
|
||||
// COM, следует установить атрибут ComVisible в TRUE для этого типа.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// Следующий GUID служит для идентификации библиотеки типов, если этот проект будет видимым для COM
|
||||
[assembly: Guid("9590b32f-4c69-48fa-ad0f-e482fb4728ab")]
|
||||
|
||||
// Сведения о версии сборки состоят из указанных ниже четырех значений:
|
||||
//
|
||||
// Основной номер версии
|
||||
// Дополнительный номер версии
|
||||
// Номер сборки
|
||||
// Редакция
|
||||
//
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// Этот код создан программным средством.
|
||||
// Версия среды выполнения: 4.0.30319.42000
|
||||
//
|
||||
// Изменения в этом файле могут привести к неправильному поведению и будут утрачены, если
|
||||
// код создан повторно.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace DatabaseViewer.Properties
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Класс ресурсов со строгим типом для поиска локализованных строк и пр.
|
||||
/// </summary>
|
||||
// Этот класс был автоматически создан при помощи StronglyTypedResourceBuilder
|
||||
// класс с помощью таких средств, как ResGen или Visual Studio.
|
||||
// Для добавления или удаления члена измените файл .ResX, а затем перезапустите ResGen
|
||||
// с параметром /str или заново постройте свой VS-проект.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources
|
||||
{
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Возврат кэшированного экземпляра ResourceManager, используемого этим классом.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager
|
||||
{
|
||||
get
|
||||
{
|
||||
if ((resourceMan == null))
|
||||
{
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("DatabaseViewer.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Переопределяет свойство CurrentUICulture текущего потока для всех
|
||||
/// подстановки ресурсов с помощью этого класса ресурсов со строгим типом.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture
|
||||
{
|
||||
get
|
||||
{
|
||||
return resourceCulture;
|
||||
}
|
||||
set
|
||||
{
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace DatabaseViewer.Properties
|
||||
{
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
|
||||
{
|
||||
|
||||
private static Settings defaultInstance = ((Settings) (global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default
|
||||
{
|
||||
get
|
||||
{
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
||||
+10
-1
@@ -1,9 +1,12 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.13.35919.96 d17.13
|
||||
VisualStudioVersion = 17.13.35919.96
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Pf2eDataScrapper", "Pf2eDataScrapper\Pf2eDataScrapper.csproj", "{FF82896A-92CA-4C63-8FDC-959ECC513773}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{D32B7787-D912-4B21-B341-7C1F42F62D36} = {D32B7787-D912-4B21-B341-7C1F42F62D36}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Элементы решения", "Элементы решения", "{754FC069-D67B-A9D7-50A1-8D1CA196D8F1}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
@@ -12,6 +15,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Элементы решен
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "output", "output", "{36D591C7-65C7-A0D1-1CBC-10CDE441BDC8}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Pf2eModel", "Pf2eModel\Pf2eModel.csproj", "{D32B7787-D912-4B21-B341-7C1F42F62D36}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -22,6 +27,10 @@ Global
|
||||
{FF82896A-92CA-4C63-8FDC-959ECC513773}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{FF82896A-92CA-4C63-8FDC-959ECC513773}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{FF82896A-92CA-4C63-8FDC-959ECC513773}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{D32B7787-D912-4B21-B341-7C1F42F62D36}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D32B7787-D912-4B21-B341-7C1F42F62D36}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D32B7787-D912-4B21-B341-7C1F42F62D36}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D32B7787-D912-4B21-B341-7C1F42F62D36}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Pf2eDataScrapper.Model;
|
||||
using Pf2eModel.Model;
|
||||
using Slugify;
|
||||
|
||||
namespace Pf2eDataScrapper.Importers;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
|
||||
namespace Pf2eDataScrapper.Importers.Implementations.Aonprd.Compendium;
|
||||
namespace Pf2eDataScrapper.Importers.Implementations.Aonprd.Compendium;
|
||||
|
||||
internal class AonprdReference(string id, string file)
|
||||
{
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
using LinqToDB;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Pf2eDataScrapper.Model;
|
||||
using Pf2eDataScrapper.Model.Base;
|
||||
using Pf2eDataScrapper.Model.Base.Source;
|
||||
using Pf2eDataScrapper.Model.Base.Targets;
|
||||
using Pf2eDataScrapper.Model.Enum;
|
||||
using Pf2eDataScrapper.Model.Structure;
|
||||
using Pf2eModel.Model;
|
||||
using Pf2eModel.Model.Base;
|
||||
using Pf2eModel.Model.Base.Source;
|
||||
using Pf2eModel.Model.Base.Targets;
|
||||
using Pf2eModel.Model.Enum;
|
||||
using Pf2eModel.Model.Structure;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
@@ -49,7 +49,7 @@ internal abstract partial class AbstractProcessor(ProcessorInput input)
|
||||
Context.SaveChanges();
|
||||
}
|
||||
|
||||
protected string AddedDescription(string path) => $"\n\n---\n[{path}]\n\n{Input.GetOptional<string>("markdown") ?? ""}";
|
||||
protected string AddedDescription(string path) => $"\n\n---\n[{path}]\n\n{Input.GetOptional<string>(path) ?? ""}";
|
||||
|
||||
protected string AddedDescription(string[] paths) => string.Join("", paths.Select(AddedDescription));
|
||||
|
||||
@@ -174,7 +174,7 @@ internal abstract partial class AbstractProcessor(ProcessorInput input)
|
||||
|
||||
if (traitsJson?.Type != JTokenType.Array)
|
||||
{
|
||||
throw new Exception("'trait' is expected to be an array");
|
||||
return;
|
||||
}
|
||||
|
||||
IEnumerable<string> names = traitsJson.ToArray().Select(jToken => jToken.ToString());
|
||||
|
||||
@@ -43,7 +43,7 @@ internal class AonprdDataBuilder(AonprdLoader loader)
|
||||
ProgressBar bar2 = new(bars, 1, 15);
|
||||
int i = 0;
|
||||
|
||||
foreach (AonprdProcessorCollection.ProcessorItem item in Processors.Items)
|
||||
foreach (AonprdProcessorCollection.ProcessorItem item in Processors.Iterate())
|
||||
{
|
||||
bar1.Refresh(i++, $"{item.Attribute.Name}");
|
||||
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
using Pf2eDataScrapper.Importers.Repositories;
|
||||
using Pf2eModel.Model.Enum;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using static LinqToDB.Reflection.Methods.LinqToDB.Insert;
|
||||
|
||||
namespace Pf2eDataScrapper.Importers.Implementations.Aonprd.DataBuilder;
|
||||
public static class AonprdEnumResolver
|
||||
{
|
||||
private static readonly ICollection<Solver> Solvers = [
|
||||
new Solver<ActionType>(new() {
|
||||
{ "Single Action", ActionType.SingleAction },
|
||||
{ "Reaction or One Action", ActionType.SingleAction },
|
||||
{ "Free Action or One Action", ActionType.SingleAction },
|
||||
{ "Two Actions", ActionType.TwoActions },
|
||||
{ "Three Actions", ActionType.ThreeActions },
|
||||
{ "Single Action to Three Actions", ActionType.SingleToThreeActions },
|
||||
{ "Single Action or more Actions", ActionType.SingleToThreeActions },
|
||||
{ "Single Action or Two Actions", ActionType.SingleToTwoActions },
|
||||
{ "Single Action to Two Actions", ActionType.SingleToTwoActions },
|
||||
}),
|
||||
|
||||
new Solver<SourceCategory>(new() {
|
||||
{ "Rulebooks", SourceCategory.Rulebooks },
|
||||
{ "Adventure Paths", SourceCategory.AdventurePaths },
|
||||
{ "Lost Omens", SourceCategory.LostOmens },
|
||||
{ "Adventures", SourceCategory.Adventures },
|
||||
{ "Comics", SourceCategory.Comics },
|
||||
{ "Blog Posts", SourceCategory.BlogPosts },
|
||||
{ "Society", SourceCategory.Society },
|
||||
}),
|
||||
];
|
||||
|
||||
public static T ResolveEventArgs<T>(string value) where T : struct, Enum
|
||||
{
|
||||
Type type = typeof(T);
|
||||
|
||||
Solver? solver = Solvers.FirstOrDefault(s => s.Type == type);
|
||||
|
||||
if (solver is null || solver.GetType() != typeof(Solver<T>))
|
||||
{
|
||||
throw new EnumResolverEnumUnknownException(type);
|
||||
}
|
||||
|
||||
Solver<T> tSolver = (Solver<T>) solver;
|
||||
|
||||
return tSolver.Data.TryGetValue(value, out var data) ? data : throw new EnumResolverValueUnknownException(type, value);
|
||||
}
|
||||
|
||||
private abstract class Solver
|
||||
{
|
||||
public abstract Type Type { get; }
|
||||
}
|
||||
|
||||
private class Solver<T>(Dictionary<string, T> data) : Solver where T : struct, Enum
|
||||
{
|
||||
public override Type Type { get; } = typeof(T);
|
||||
public Dictionary<string, T> Data { get; } = data;
|
||||
}
|
||||
|
||||
public class EnumResolverEnumUnknownException(Type t) : Exception($"Can't resolve type '{t.FullName}': Solver not defined");
|
||||
|
||||
public class EnumResolverValueUnknownException(Type t, string value) : Exception($"Can't resolve type '{t.FullName}': Value '{value}' is not matched");
|
||||
|
||||
}
|
||||
+3
-3
@@ -1,14 +1,14 @@
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Pf2eDataScrapper.Model.Enum;
|
||||
using Pf2eModel.Model.Enum;
|
||||
|
||||
namespace Pf2eDataScrapper.Importers.Implementations.Aonprd.DataBuilder.Processors;
|
||||
|
||||
[AonprdProcessor("action")]
|
||||
internal class ActionProcessor(ProcessorInput input) : AbstractProcessor(input)
|
||||
{
|
||||
public override EntityType Type => EntityType.Trait;
|
||||
public override EntityType Type => EntityType.Action;
|
||||
|
||||
public override Model.Structure.Action Object { get; } = new();
|
||||
public override Pf2eModel.Model.Structure.Action Object { get; } = new();
|
||||
|
||||
public override void Process()
|
||||
{
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
using Pf2eDataScrapper.Model.Enum;
|
||||
using Pf2eDataScrapper.Model.Structure;
|
||||
using Pf2eModel.Model.Enum;
|
||||
using Pf2eModel.Model.Structure;
|
||||
|
||||
namespace Pf2eDataScrapper.Importers.Implementations.Aonprd.DataBuilder.Processors;
|
||||
|
||||
|
||||
+6
-6
@@ -1,11 +1,11 @@
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Pf2eDataScrapper.Importers.Implementations.Aonprd.DataBuilder;
|
||||
using Pf2eDataScrapper.Model;
|
||||
using Pf2eDataScrapper.Model.Base;
|
||||
using Pf2eDataScrapper.Model.Base.Source;
|
||||
using Pf2eDataScrapper.Model.Base.Targets;
|
||||
using Pf2eDataScrapper.Model.Enum;
|
||||
using Pf2eDataScrapper.Model.Structure;
|
||||
using Pf2eModel.Model;
|
||||
using Pf2eModel.Model.Base;
|
||||
using Pf2eModel.Model.Base.Source;
|
||||
using Pf2eModel.Model.Base.Targets;
|
||||
using Pf2eModel.Model.Enum;
|
||||
using Pf2eModel.Model.Structure;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
|
||||
|
||||
+6
-6
@@ -1,5 +1,5 @@
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Pf2eDataScrapper.Model.Enum;
|
||||
using Pf2eModel.Model.Enum;
|
||||
|
||||
namespace Pf2eDataScrapper.Importers.Implementations.Pf2eFoundry.DataBuilder.Processors;
|
||||
|
||||
@@ -8,17 +8,17 @@ internal class ActionProcessor(JObject input) : AbstractProcessor(input)
|
||||
{
|
||||
public override EntityType Type => EntityType.Action;
|
||||
|
||||
public override Model.Structure.Action Object { get; } = new();
|
||||
public override Pf2eModel.Model.Structure.Action Object { get; } = new();
|
||||
|
||||
public override void Process()
|
||||
{
|
||||
base.Process();
|
||||
|
||||
/*
|
||||
Object.Type = EnumRequired<ActionType>("system.actionType.value");
|
||||
// Object.Category = EnumOptional<ActionCategory>("system.category", ActionCategory.Unknown);
|
||||
Object.Category = EnumOptional<ActionCategory>("system.category", ActionCategory.Unknown);
|
||||
Object.Actions = GetOptional<int>("system.actions.value");
|
||||
// Object.DeathNote = GetOptional<bool>("system.deathNote");
|
||||
|
||||
Object.DeathNote = GetOptional<bool>("system.deathNote");
|
||||
*/
|
||||
JObject extra = new()
|
||||
{
|
||||
{ "selfEffect", Input.SelectToken("system.selfEffect") }
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Pf2eDataScrapper.Model.Enum;
|
||||
using Pf2eDataScrapper.Model.Structure;
|
||||
using Pf2eModel.Model.Enum;
|
||||
using Pf2eModel.Model.Structure;
|
||||
|
||||
namespace Pf2eDataScrapper.Importers.Implementations.Pf2eFoundry.DataBuilder.Processors;
|
||||
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
using NpgsqlTypes;
|
||||
using Pf2eDataScrapper.Importers.Implementations.Aonprd.DataBuilder;
|
||||
|
||||
namespace Pf2eDataScrapper.Model.Enum;
|
||||
|
||||
public enum ActionType
|
||||
{
|
||||
[PgName("none")]
|
||||
None,
|
||||
|
||||
[AonprdEnum(["Single Action", "Reaction or One Action", "Free Action or One Action"])]
|
||||
[PgName("1_action")]
|
||||
SingleAction,
|
||||
|
||||
[AonprdEnum("Two Actions")]
|
||||
[PgName("2_actions")]
|
||||
TwoActions,
|
||||
|
||||
[AonprdEnum("Three Actions")]
|
||||
[PgName("3_actions")]
|
||||
ThreeActions,
|
||||
|
||||
[AonprdEnum(["Single Action to Three Actions", "Single Action or more Actions"])]
|
||||
[PgName("1-3_actions")]
|
||||
SingleToThreeActions,
|
||||
|
||||
[AonprdEnum(["Single Action or Two Actions", "Single Action to Two Actions"])]
|
||||
[PgName("1-2_actions")]
|
||||
SingleToTwoActions,
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
using NpgsqlTypes;
|
||||
using Pf2eDataScrapper.Importers.Implementations.Aonprd.DataBuilder;
|
||||
|
||||
namespace Pf2eDataScrapper.Model.Enum;
|
||||
public enum SourceCategory
|
||||
{
|
||||
[PgName("rulebook")]
|
||||
[AonprdEnum("Rulebooks")]
|
||||
Rulebooks,
|
||||
|
||||
[PgName("adventure-path")]
|
||||
[AonprdEnum("Adventure Paths")]
|
||||
AdventurePaths,
|
||||
|
||||
[PgName("lost-omens")]
|
||||
[AonprdEnum("Lost Omens")]
|
||||
LostOmens,
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
using Pf2eDataScrapper.Model.Base;
|
||||
|
||||
namespace Pf2eDataScrapper.Model;
|
||||
|
||||
internal interface IEntity
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
public Entity Entity { get; set; }
|
||||
|
||||
}
|
||||
@@ -24,6 +24,10 @@
|
||||
<PackageReference Include="Slugify.Core" Version="5.1.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Pf2eModel\Pf2eModel.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update=".env">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
@@ -33,8 +37,4 @@
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Migrations\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
using Pf2eDataScrapper;
|
||||
using Pf2eDataScrapper.Importers.Implementations.Aonprd;
|
||||
|
||||
Console.SetWindowSize(Console.LargestWindowWidth - 20, Console.LargestWindowHeight - 10);
|
||||
|
||||
EnvSettings.Load();
|
||||
|
||||
/*
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
using Pf2eModel.Model;
|
||||
using Pf2eModel.Model.Enum;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Pf2eModel.Migrations
|
||||
{
|
||||
[DbContext(typeof(Pf2eDbContext))]
|
||||
[Migration("20250418062358_Function")]
|
||||
partial class Function
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Pf2eModel.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class Function : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.Sql("""
|
||||
CREATE OR REPLACE FUNCTION f_truncate_tables()
|
||||
RETURNS void
|
||||
LANGUAGE plpgsql AS
|
||||
$func$
|
||||
BEGIN
|
||||
EXECUTE
|
||||
(SELECT 'TRUNCATE TABLE '
|
||||
|| string_agg(format('%I.%I', schemaname, tablename), ', ')
|
||||
|| ' CASCADE;'
|
||||
FROM pg_tables
|
||||
WHERE schemaname = 'public'
|
||||
AND tablename != '__EFMigrationsHistory'
|
||||
);
|
||||
END
|
||||
$func$;
|
||||
""");
|
||||
migrationBuilder.Sql("""
|
||||
CREATE OR REPLACE FUNCTION f_drop_tables()
|
||||
RETURNS void
|
||||
LANGUAGE plpgsql AS
|
||||
$func$
|
||||
BEGIN
|
||||
EXECUTE
|
||||
(SELECT 'DROP TABLE '
|
||||
|| string_agg(format('%I.%I', schemaname, tablename), ', ')
|
||||
|| ' CASCADE;'
|
||||
FROM pg_tables
|
||||
WHERE schemaname = 'public'
|
||||
);
|
||||
END
|
||||
$func$;
|
||||
""");
|
||||
migrationBuilder.Sql("""
|
||||
CREATE OR REPLACE FUNCTION f_permission_tables(_username text)
|
||||
RETURNS void
|
||||
LANGUAGE plpgsql AS
|
||||
$func$
|
||||
DECLARE
|
||||
_tbl text;
|
||||
_sch text;
|
||||
BEGIN
|
||||
FOR _sch, _tbl IN
|
||||
SELECT schemaname, tablename
|
||||
FROM pg_tables
|
||||
WHERE schemaname = 'public'
|
||||
LOOP
|
||||
EXECUTE format('ALTER TABLE %I.%I OWNER TO %I', _sch, _tbl, _username);
|
||||
END LOOP;
|
||||
END
|
||||
$func$;
|
||||
""");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.Sql("DROP FUNCTION f_truncate_tables;");
|
||||
migrationBuilder.Sql("DROP FUNCTION f_drop_tables;");
|
||||
migrationBuilder.Sql("DROP FUNCTION f_permission_tables;");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,13 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Pf2eDataScrapper.Model.Base.Keywords;
|
||||
using Pf2eDataScrapper.Model.Base.Source;
|
||||
using Pf2eDataScrapper.Model.Base.Targets;
|
||||
using Pf2eDataScrapper.Model.Enum;
|
||||
using Pf2eDataScrapper.Model.Structure;
|
||||
using Pf2eModel.Model.Base.Keywords;
|
||||
using Pf2eModel.Model.Base.Source;
|
||||
using Pf2eModel.Model.Base.Targets;
|
||||
using Pf2eModel.Model.Enum;
|
||||
using Pf2eModel.Model.Structure;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Pf2eDataScrapper.Model.Base;
|
||||
namespace Pf2eModel.Model.Base;
|
||||
|
||||
public class Entity
|
||||
{
|
||||
@@ -1,9 +1,9 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Pf2eDataScrapper.Model.Enum;
|
||||
using Pf2eModel.Model.Enum;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Pf2eDataScrapper.Model.Base;
|
||||
namespace Pf2eModel.Model.Base;
|
||||
|
||||
[PrimaryKey(nameof(EntityId), nameof(Type))]
|
||||
public partial class EntityAlias
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Pf2eDataScrapper.Model.Base.Keywords;
|
||||
namespace Pf2eModel.Model.Base.Keywords;
|
||||
|
||||
public partial class Keyword
|
||||
{
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Pf2eDataScrapper.Model.Base.Keywords;
|
||||
namespace Pf2eModel.Model.Base.Keywords;
|
||||
|
||||
public partial class KeywordAlias
|
||||
{
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Pf2eDataScrapper.Model.Base.Source;
|
||||
namespace Pf2eModel.Model.Base.Source;
|
||||
|
||||
[PrimaryKey(nameof(EntityId), nameof(SourceId))]
|
||||
public partial class EntitySource
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
using Pf2eDataScrapper.Model.Enum;
|
||||
using Pf2eModel.Model.Enum;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Pf2eDataScrapper.Model.Base.Source;
|
||||
namespace Pf2eModel.Model.Base.Source;
|
||||
|
||||
public partial class Source
|
||||
{
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Pf2eDataScrapper.Model.Base.Targets;
|
||||
namespace Pf2eModel.Model.Base.Targets;
|
||||
|
||||
[PrimaryKey(nameof(EntityId), nameof(TargetId))]
|
||||
public partial class EntityExternal
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Pf2eDataScrapper.Model.Base.Targets;
|
||||
namespace Pf2eModel.Model.Base.Targets;
|
||||
|
||||
public partial class ExternalTarget
|
||||
{
|
||||
@@ -1,7 +1,7 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Pf2eDataScrapper.Model.Common;
|
||||
namespace Pf2eModel.Model.Common;
|
||||
|
||||
public partial class Frequency
|
||||
{
|
||||
@@ -1,8 +1,8 @@
|
||||
using Pf2eDataScrapper.Model.Enum;
|
||||
using Pf2eModel.Model.Enum;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Pf2eDataScrapper.Model.Common;
|
||||
namespace Pf2eModel.Model.Common;
|
||||
|
||||
public partial class Language
|
||||
{
|
||||
@@ -1,7 +1,7 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Pf2eDataScrapper.Model.Common;
|
||||
namespace Pf2eModel.Model.Common;
|
||||
|
||||
public partial class Training
|
||||
{
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
using NpgsqlTypes;
|
||||
|
||||
namespace Pf2eDataScrapper.Model.Enum;
|
||||
namespace Pf2eModel.Model.Enum;
|
||||
|
||||
public enum ActionCategory
|
||||
{
|
||||
@@ -0,0 +1,24 @@
|
||||
using NpgsqlTypes;
|
||||
|
||||
namespace Pf2eModel.Model.Enum;
|
||||
|
||||
public enum ActionType
|
||||
{
|
||||
[PgName("none")]
|
||||
None,
|
||||
|
||||
[PgName("1_action")]
|
||||
SingleAction,
|
||||
|
||||
[PgName("2_actions")]
|
||||
TwoActions,
|
||||
|
||||
[PgName("3_actions")]
|
||||
ThreeActions,
|
||||
|
||||
[PgName("1-3_actions")]
|
||||
SingleToThreeActions,
|
||||
|
||||
[PgName("1-2_actions")]
|
||||
SingleToTwoActions,
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
using NpgsqlTypes;
|
||||
|
||||
namespace Pf2eDataScrapper.Model.Enum;
|
||||
namespace Pf2eModel.Model.Enum;
|
||||
|
||||
public enum AliasType
|
||||
{
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
using NpgsqlTypes;
|
||||
|
||||
namespace Pf2eDataScrapper.Model.Enum;
|
||||
namespace Pf2eModel.Model.Enum;
|
||||
|
||||
public enum AncestryVision
|
||||
{
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
using NpgsqlTypes;
|
||||
|
||||
namespace Pf2eDataScrapper.Model.Enum;
|
||||
namespace Pf2eModel.Model.Enum;
|
||||
|
||||
public enum AttributeValues
|
||||
{
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
using NpgsqlTypes;
|
||||
|
||||
namespace Pf2eDataScrapper.Model.Enum;
|
||||
namespace Pf2eModel.Model.Enum;
|
||||
|
||||
public enum ClassProgressionType
|
||||
{
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
using NpgsqlTypes;
|
||||
|
||||
namespace Pf2eDataScrapper.Model.Enum;
|
||||
namespace Pf2eModel.Model.Enum;
|
||||
|
||||
|
||||
public enum ConditionGroup
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
using NpgsqlTypes;
|
||||
|
||||
namespace Pf2eDataScrapper.Model.Enum;
|
||||
namespace Pf2eModel.Model.Enum;
|
||||
|
||||
public enum DeityCategory
|
||||
{
|
||||
@@ -1,6 +1,6 @@
|
||||
using NpgsqlTypes;
|
||||
|
||||
namespace Pf2eDataScrapper.Model.Enum;
|
||||
namespace Pf2eModel.Model.Enum;
|
||||
|
||||
public enum DeityFonts
|
||||
{
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
using NpgsqlTypes;
|
||||
|
||||
namespace Pf2eDataScrapper.Model.Enum;
|
||||
namespace Pf2eModel.Model.Enum;
|
||||
|
||||
public enum DeitySanctification
|
||||
{
|
||||
@@ -1,6 +1,6 @@
|
||||
using NpgsqlTypes;
|
||||
|
||||
namespace Pf2eDataScrapper.Model.Enum;
|
||||
namespace Pf2eModel.Model.Enum;
|
||||
|
||||
public enum EntityRarity
|
||||
{
|
||||
@@ -1,6 +1,6 @@
|
||||
using NpgsqlTypes;
|
||||
|
||||
namespace Pf2eDataScrapper.Model.Enum;
|
||||
namespace Pf2eModel.Model.Enum;
|
||||
|
||||
public enum EntityType
|
||||
{
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
using NpgsqlTypes;
|
||||
|
||||
namespace Pf2eDataScrapper.Model.Enum;
|
||||
namespace Pf2eModel.Model.Enum;
|
||||
|
||||
public enum FeatActionType
|
||||
{
|
||||
@@ -1,6 +1,6 @@
|
||||
using NpgsqlTypes;
|
||||
|
||||
namespace Pf2eDataScrapper.Model.Enum;
|
||||
namespace Pf2eModel.Model.Enum;
|
||||
|
||||
public enum FeatCategory
|
||||
{
|
||||
@@ -1,6 +1,6 @@
|
||||
using NpgsqlTypes;
|
||||
|
||||
namespace Pf2eDataScrapper.Model.Enum;
|
||||
namespace Pf2eModel.Model.Enum;
|
||||
|
||||
public enum Size
|
||||
{
|
||||
@@ -0,0 +1,26 @@
|
||||
using NpgsqlTypes;
|
||||
|
||||
namespace Pf2eModel.Model.Enum;
|
||||
public enum SourceCategory
|
||||
{
|
||||
[PgName("rulebook")]
|
||||
Rulebooks,
|
||||
|
||||
[PgName("adventure-path")]
|
||||
AdventurePaths,
|
||||
|
||||
[PgName("lost-omens")]
|
||||
LostOmens,
|
||||
|
||||
[PgName("adventures")]
|
||||
Adventures,
|
||||
|
||||
[PgName("comics")]
|
||||
Comics,
|
||||
|
||||
[PgName("blog-posts")]
|
||||
BlogPosts,
|
||||
|
||||
[PgName("society")]
|
||||
Society,
|
||||
}
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
using NpgsqlTypes;
|
||||
|
||||
namespace Pf2eDataScrapper.Model.Enum;
|
||||
namespace Pf2eModel.Model.Enum;
|
||||
|
||||
public enum SpellAreaType
|
||||
{
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
using NpgsqlTypes;
|
||||
|
||||
namespace Pf2eDataScrapper.Model.Enum;
|
||||
namespace Pf2eModel.Model.Enum;
|
||||
|
||||
public enum SpellDamageCategory
|
||||
{
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
using NpgsqlTypes;
|
||||
|
||||
namespace Pf2eDataScrapper.Model.Enum;
|
||||
namespace Pf2eModel.Model.Enum;
|
||||
|
||||
public enum SpellDamageKinds
|
||||
{
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
namespace Pf2eDataScrapper.Model.Enum;
|
||||
namespace Pf2eModel.Model.Enum;
|
||||
public enum TrainingStage
|
||||
{
|
||||
Untrained = 0,
|
||||
@@ -1,6 +1,6 @@
|
||||
using NpgsqlTypes;
|
||||
|
||||
namespace Pf2eDataScrapper.Model.Enum;
|
||||
namespace Pf2eModel.Model.Enum;
|
||||
|
||||
public enum TraitType
|
||||
{
|
||||
@@ -0,0 +1,11 @@
|
||||
using Pf2eModel.Model.Base;
|
||||
|
||||
namespace Pf2eModel.Model;
|
||||
|
||||
public interface IEntity
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
public Entity Entity { get; set; }
|
||||
|
||||
}
|
||||
@@ -1,19 +1,21 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Pf2eDataScrapper.Model.Base;
|
||||
using Pf2eDataScrapper.Model.Base.Keywords;
|
||||
using Pf2eDataScrapper.Model.Base.Source;
|
||||
using Pf2eDataScrapper.Model.Base.Targets;
|
||||
using Pf2eDataScrapper.Model.Common;
|
||||
using Pf2eDataScrapper.Model.Enum;
|
||||
using Pf2eDataScrapper.Model.Structure;
|
||||
using Pf2eDataScrapper.Model.Structure.AncestryRelation;
|
||||
using Pf2eDataScrapper.Model.Structure.BackgroundRelation;
|
||||
using Pf2eDataScrapper.Model.Structure.ClassRelation;
|
||||
using Pf2eDataScrapper.Model.Structure.DeityRelation;
|
||||
using Pf2eDataScrapper.Model.Structure.FeatRelation;
|
||||
using Pf2eDataScrapper.Model.Structure.SpellRelation;
|
||||
using dotenv.net;
|
||||
using dotenv.net.Utilities;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Pf2eModel.Model.Base;
|
||||
using Pf2eModel.Model.Base.Keywords;
|
||||
using Pf2eModel.Model.Base.Source;
|
||||
using Pf2eModel.Model.Base.Targets;
|
||||
using Pf2eModel.Model.Common;
|
||||
using Pf2eModel.Model.Enum;
|
||||
using Pf2eModel.Model.Structure;
|
||||
using Pf2eModel.Model.Structure.AncestryRelation;
|
||||
using Pf2eModel.Model.Structure.BackgroundRelation;
|
||||
using Pf2eModel.Model.Structure.ClassRelation;
|
||||
using Pf2eModel.Model.Structure.DeityRelation;
|
||||
using Pf2eModel.Model.Structure.FeatRelation;
|
||||
using Pf2eModel.Model.Structure.SpellRelation;
|
||||
|
||||
namespace Pf2eDataScrapper.Model;
|
||||
namespace Pf2eModel.Model;
|
||||
|
||||
public partial class Pf2eDbContext : DbContext
|
||||
{
|
||||
@@ -110,10 +112,11 @@ public partial class Pf2eDbContext : DbContext
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
EnvSettings.Load();
|
||||
DotEnv.Load();
|
||||
|
||||
// optionsBuilder.LogTo(Console.WriteLine);
|
||||
optionsBuilder.UseSnakeCaseNamingConvention();
|
||||
optionsBuilder.UseNpgsql(EnvSettings.DatabaseConnection,
|
||||
optionsBuilder.UseNpgsql(EnvReader.GetStringValue("DATABASE_CONNECTION"),
|
||||
builder =>
|
||||
{
|
||||
builder
|
||||
+41
-16
@@ -1,21 +1,22 @@
|
||||
using LinqToDB.Common;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
using Pf2eDataScrapper.Model.Base;
|
||||
using Pf2eDataScrapper.Model.Base.Keywords;
|
||||
using Pf2eDataScrapper.Model.Base.Source;
|
||||
using Pf2eDataScrapper.Model.Base.Targets;
|
||||
using Pf2eDataScrapper.Model.Common;
|
||||
using Pf2eDataScrapper.Model.Enum;
|
||||
using Pf2eDataScrapper.Model.Structure;
|
||||
using Pf2eDataScrapper.Model.Structure.AncestryRelation;
|
||||
using Pf2eDataScrapper.Model.Structure.BackgroundRelation;
|
||||
using Pf2eDataScrapper.Model.Structure.ClassRelation;
|
||||
using Pf2eDataScrapper.Model.Structure.DeityRelation;
|
||||
using Pf2eDataScrapper.Model.Structure.FeatRelation;
|
||||
using Pf2eDataScrapper.Model.Structure.SpellRelation;
|
||||
using Pf2eModel.Model.Base;
|
||||
using Pf2eModel.Model.Base.Keywords;
|
||||
using Pf2eModel.Model.Base.Source;
|
||||
using Pf2eModel.Model.Base.Targets;
|
||||
using Pf2eModel.Model.Common;
|
||||
using Pf2eModel.Model.Enum;
|
||||
using Pf2eModel.Model.Structure;
|
||||
using Pf2eModel.Model.Structure.AncestryRelation;
|
||||
using Pf2eModel.Model.Structure.BackgroundRelation;
|
||||
using Pf2eModel.Model.Structure.ClassRelation;
|
||||
using Pf2eModel.Model.Structure.DeityRelation;
|
||||
using Pf2eModel.Model.Structure.FeatRelation;
|
||||
using Pf2eModel.Model.Structure.SpellRelation;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Pf2eDataScrapper.Model;
|
||||
namespace Pf2eModel.Model;
|
||||
|
||||
public partial class Pf2eDbContext
|
||||
{
|
||||
@@ -29,7 +30,7 @@ public partial class Pf2eDbContext
|
||||
DefineBase(modelBuilder);
|
||||
DefineCommon(modelBuilder);
|
||||
DefineStructure(modelBuilder);
|
||||
DefineFunctions();
|
||||
DefineFunctions(modelBuilder);
|
||||
}
|
||||
|
||||
private void DefineEnums(ModelBuilder modelBuilder)
|
||||
@@ -327,8 +328,31 @@ public partial class Pf2eDbContext
|
||||
});
|
||||
}
|
||||
|
||||
private void DefineFunctions()
|
||||
|
||||
private void DefineFunctions(ModelBuilder modelBuilder)
|
||||
{
|
||||
// modelBuilder.HasDbFunction(typeof(Pf2eDbContext).GetMethod(nameof(FTruncateTables), Array.Empty<Type>()))
|
||||
/*
|
||||
modelBuilder.HasPostgresExtension($"""
|
||||
CREATE OR REPLACE FUNCTION f_truncate_tables()
|
||||
RETURNS void
|
||||
LANGUAGE plpgsql AS
|
||||
$func$
|
||||
BEGIN
|
||||
EXECUTE (
|
||||
SELECT 'TRUNCATE TABLE '
|
||||
|| string_agg(format('%I.%I', schemaname, tablename), ', ')
|
||||
|| ' CASCADE;'
|
||||
FROM pg_tables
|
||||
WHERE schemaname = 'public'
|
||||
AND tablename != '__EFMigrationsHistory'
|
||||
);
|
||||
END
|
||||
$func$;
|
||||
""")
|
||||
;
|
||||
|
||||
/*
|
||||
Database.ExecuteSql($"""
|
||||
CREATE OR REPLACE FUNCTION f_truncate_tables()
|
||||
RETURNS void
|
||||
@@ -383,5 +407,6 @@ public partial class Pf2eDbContext
|
||||
END
|
||||
$func$;
|
||||
""");
|
||||
*/
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
using Pf2eDataScrapper.Model.Base;
|
||||
using Pf2eDataScrapper.Model.Enum;
|
||||
using Pf2eModel.Model.Base;
|
||||
using Pf2eModel.Model.Enum;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Pf2eDataScrapper.Model.Structure;
|
||||
namespace Pf2eModel.Model.Structure;
|
||||
|
||||
public partial class Action : IEntity
|
||||
{
|
||||
+4
-4
@@ -1,9 +1,9 @@
|
||||
using Pf2eDataScrapper.Model.Base;
|
||||
using Pf2eDataScrapper.Model.Enum;
|
||||
using Pf2eDataScrapper.Model.Structure.AncestryRelation;
|
||||
using Pf2eModel.Model.Base;
|
||||
using Pf2eModel.Model.Enum;
|
||||
using Pf2eModel.Model.Structure.AncestryRelation;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Pf2eDataScrapper.Model.Structure;
|
||||
namespace Pf2eModel.Model.Structure;
|
||||
|
||||
public partial class Ancestry : IEntity
|
||||
{
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Pf2eDataScrapper.Model.Structure.AncestryRelation;
|
||||
namespace Pf2eModel.Model.Structure.AncestryRelation;
|
||||
|
||||
public partial class AncestryBoost
|
||||
{
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Pf2eDataScrapper.Model.Base;
|
||||
using Pf2eModel.Model.Base;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Pf2eDataScrapper.Model.Structure.AncestryRelation;
|
||||
namespace Pf2eModel.Model.Structure.AncestryRelation;
|
||||
|
||||
[PrimaryKey(nameof(AncestryId), nameof(ItemId))]
|
||||
public partial class AncestryItem
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Pf2eDataScrapper.Model.Common;
|
||||
using Pf2eModel.Model.Common;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Pf2eDataScrapper.Model.Structure.AncestryRelation;
|
||||
namespace Pf2eModel.Model.Structure.AncestryRelation;
|
||||
|
||||
[PrimaryKey(nameof(AncestryId), nameof(LanguageId))]
|
||||
public partial class AncestryLanguage
|
||||
+3
-3
@@ -1,9 +1,9 @@
|
||||
using Pf2eDataScrapper.Model.Base;
|
||||
using Pf2eDataScrapper.Model.Structure.BackgroundRelation;
|
||||
using Pf2eModel.Model.Base;
|
||||
using Pf2eModel.Model.Structure.BackgroundRelation;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Pf2eDataScrapper.Model.Structure;
|
||||
namespace Pf2eModel.Model.Structure;
|
||||
|
||||
public partial class Background : IEntity
|
||||
{
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
using Pf2eDataScrapper.Model.Enum;
|
||||
using Pf2eModel.Model.Enum;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Pf2eDataScrapper.Model.Structure.BackgroundRelation;
|
||||
namespace Pf2eModel.Model.Structure.BackgroundRelation;
|
||||
|
||||
public partial class BackgroundBoost
|
||||
{
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Pf2eDataScrapper.Model.Base;
|
||||
using Pf2eModel.Model.Base;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Pf2eDataScrapper.Model.Structure.BackgroundRelation;
|
||||
namespace Pf2eModel.Model.Structure.BackgroundRelation;
|
||||
|
||||
[PrimaryKey(nameof(BackgroundId), nameof(EntityId))]
|
||||
public partial class BackgroundItem
|
||||
+3
-3
@@ -1,9 +1,9 @@
|
||||
using Pf2eDataScrapper.Model.Common;
|
||||
using Pf2eDataScrapper.Model.Enum;
|
||||
using Pf2eModel.Model.Common;
|
||||
using Pf2eModel.Model.Enum;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Pf2eDataScrapper.Model.Structure.BackgroundRelation;
|
||||
namespace Pf2eModel.Model.Structure.BackgroundRelation;
|
||||
|
||||
public partial class BackgroundTraining
|
||||
{
|
||||
@@ -1,9 +1,9 @@
|
||||
using Pf2eDataScrapper.Model.Base;
|
||||
using Pf2eDataScrapper.Model.Structure.ClassRelation;
|
||||
using Pf2eModel.Model.Base;
|
||||
using Pf2eModel.Model.Structure.ClassRelation;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Pf2eDataScrapper.Model.Structure;
|
||||
namespace Pf2eModel.Model.Structure;
|
||||
|
||||
public partial class Class : IEntity
|
||||
{
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
using Pf2eDataScrapper.Model.Enum;
|
||||
using Pf2eModel.Model.Enum;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Pf2eDataScrapper.Model.Structure.ClassRelation;
|
||||
namespace Pf2eModel.Model.Structure.ClassRelation;
|
||||
|
||||
public partial class ClassKeyAbility
|
||||
{
|
||||
+3
-3
@@ -1,9 +1,9 @@
|
||||
using Pf2eDataScrapper.Model.Base;
|
||||
using Pf2eDataScrapper.Model.Enum;
|
||||
using Pf2eModel.Model.Base;
|
||||
using Pf2eModel.Model.Enum;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Pf2eDataScrapper.Model.Structure.ClassRelation;
|
||||
namespace Pf2eModel.Model.Structure.ClassRelation;
|
||||
public partial class ClassProgression
|
||||
{
|
||||
[Key]
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
using Pf2eDataScrapper.Model.Common;
|
||||
using Pf2eModel.Model.Common;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Pf2eDataScrapper.Model.Structure.ClassRelation;
|
||||
namespace Pf2eModel.Model.Structure.ClassRelation;
|
||||
|
||||
public partial class ClassTraining
|
||||
{
|
||||
+3
-3
@@ -1,9 +1,9 @@
|
||||
using Pf2eDataScrapper.Model.Base;
|
||||
using Pf2eDataScrapper.Model.Enum;
|
||||
using Pf2eModel.Model.Base;
|
||||
using Pf2eModel.Model.Enum;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Pf2eDataScrapper.Model.Structure;
|
||||
namespace Pf2eModel.Model.Structure;
|
||||
|
||||
public partial class Condition : IEntity
|
||||
{
|
||||
@@ -1,11 +1,11 @@
|
||||
using Pf2eDataScrapper.Model.Base;
|
||||
using Pf2eDataScrapper.Model.Common;
|
||||
using Pf2eDataScrapper.Model.Enum;
|
||||
using Pf2eDataScrapper.Model.Structure.DeityRelation;
|
||||
using Pf2eModel.Model.Base;
|
||||
using Pf2eModel.Model.Common;
|
||||
using Pf2eModel.Model.Enum;
|
||||
using Pf2eModel.Model.Structure.DeityRelation;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Pf2eDataScrapper.Model.Structure;
|
||||
namespace Pf2eModel.Model.Structure;
|
||||
|
||||
public partial class Deity : IEntity
|
||||
{
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Pf2eDataScrapper.Model.Enum;
|
||||
using Pf2eModel.Model.Enum;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Pf2eDataScrapper.Model.Structure.DeityRelation;
|
||||
namespace Pf2eModel.Model.Structure.DeityRelation;
|
||||
|
||||
[PrimaryKey(nameof(DeityId), nameof(Attribute))]
|
||||
public partial class DeityAttribute
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Pf2eDataScrapper.Model.Structure.DeityRelation;
|
||||
namespace Pf2eModel.Model.Structure.DeityRelation;
|
||||
|
||||
public partial class DeityDomain
|
||||
{
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Pf2eDataScrapper.Model.Structure.DeityRelation;
|
||||
namespace Pf2eModel.Model.Structure.DeityRelation;
|
||||
|
||||
public partial class DeitySpell
|
||||
{
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Pf2eDataScrapper.Model.Structure.DeityRelation;
|
||||
namespace Pf2eModel.Model.Structure.DeityRelation;
|
||||
|
||||
public partial class DeityWeapon
|
||||
{
|
||||
@@ -1,10 +1,10 @@
|
||||
using Pf2eDataScrapper.Model.Base;
|
||||
using Pf2eDataScrapper.Model.Enum;
|
||||
using Pf2eDataScrapper.Model.Structure.FeatRelation;
|
||||
using Pf2eModel.Model.Base;
|
||||
using Pf2eModel.Model.Enum;
|
||||
using Pf2eModel.Model.Structure.FeatRelation;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Pf2eDataScrapper.Model.Structure;
|
||||
namespace Pf2eModel.Model.Structure;
|
||||
|
||||
public partial class Feat : IEntity
|
||||
{
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Pf2eDataScrapper.Model.Structure.FeatRelation;
|
||||
namespace Pf2eModel.Model.Structure.FeatRelation;
|
||||
|
||||
public partial class FeatPrerequisite
|
||||
{
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
using Pf2eDataScrapper.Model.Base;
|
||||
using Pf2eModel.Model.Base;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Pf2eDataScrapper.Model.Structure;
|
||||
namespace Pf2eModel.Model.Structure;
|
||||
|
||||
public partial class Heritage : IEntity
|
||||
{
|
||||
@@ -1,9 +1,9 @@
|
||||
using Pf2eDataScrapper.Model.Base;
|
||||
using Pf2eDataScrapper.Model.Structure.SpellRelation;
|
||||
using Pf2eModel.Model.Base;
|
||||
using Pf2eModel.Model.Structure.SpellRelation;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Pf2eDataScrapper.Model.Structure;
|
||||
namespace Pf2eModel.Model.Structure;
|
||||
|
||||
public partial class Spell : IEntity
|
||||
{
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
using Pf2eDataScrapper.Model.Enum;
|
||||
using Pf2eModel.Model.Enum;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Pf2eDataScrapper.Model.Structure.SpellRelation;
|
||||
namespace Pf2eModel.Model.Structure.SpellRelation;
|
||||
|
||||
public partial class SpellArea
|
||||
{
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
using Pf2eDataScrapper.Model.Enum;
|
||||
using Pf2eModel.Model.Enum;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Pf2eDataScrapper.Model.Structure.SpellRelation;
|
||||
namespace Pf2eModel.Model.Structure.SpellRelation;
|
||||
|
||||
public partial class SpellDamage
|
||||
{
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Pf2eDataScrapper.Model.Structure.SpellRelation;
|
||||
namespace Pf2eModel.Model.Structure.SpellRelation;
|
||||
|
||||
public partial class SpellDefense
|
||||
{
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Pf2eDataScrapper.Model.Structure.SpellRelation;
|
||||
namespace Pf2eModel.Model.Structure.SpellRelation;
|
||||
|
||||
public partial class SpellRitual
|
||||
{
|
||||
@@ -1,9 +1,9 @@
|
||||
using Pf2eDataScrapper.Model.Base;
|
||||
using Pf2eDataScrapper.Model.Enum;
|
||||
using Pf2eModel.Model.Base;
|
||||
using Pf2eModel.Model.Enum;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Pf2eDataScrapper.Model.Structure;
|
||||
namespace Pf2eModel.Model.Structure;
|
||||
|
||||
public partial class Trait : IEntity
|
||||
{
|
||||
@@ -0,0 +1,24 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Include="..\Pf2eDataScrapper\.env" Link=".env">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="dotenv.net" Version="3.2.1" />
|
||||
<PackageReference Include="EFCore.NamingConventions" Version="9.0.0" />
|
||||
<PackageReference Include="linq2db" Version="5.4.1" />
|
||||
<PackageReference Include="linq2db.EntityFrameworkCore" Version="9.0.0" />
|
||||
<PackageReference Include="Npgsql" Version="9.0.3" />
|
||||
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.0.4" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
Reference in New Issue
Block a user