Tidy up, updated ItemBaseTypes and ItemClasses files to Path of Exile 2.3.4
This commit is contained in:
29
Filtration.ItemFilterPreview.Data/App.config
Normal file
29
Filtration.ItemFilterPreview.Data/App.config
Normal file
@@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
|
||||
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
|
||||
</configSections>
|
||||
<entityFramework>
|
||||
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
|
||||
<parameters>
|
||||
<parameter value="mssqllocaldb" />
|
||||
</parameters>
|
||||
</defaultConnectionFactory>
|
||||
<providers>
|
||||
<provider invariantName="System.Data.SQLite.EF6" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6" />
|
||||
</providers>
|
||||
</entityFramework>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
|
||||
</startup>
|
||||
|
||||
<connectionStrings>
|
||||
<add name="FiltrationDbContext" connectionString="data source="D:\C# Projects\Filtration\Filtration.db"" providerName="System.Data.SQLite.EF6" />
|
||||
</connectionStrings>
|
||||
<system.data>
|
||||
<DbProviderFactories>
|
||||
<remove invariant="System.Data.SQLite.EF6" />
|
||||
<add name="SQLite Data Provider (Entity Framework 6)" invariant="System.Data.SQLite.EF6" description=".NET Framework Data Provider for SQLite (Entity Framework 6)" type="System.Data.SQLite.EF6.SQLiteProviderFactory, System.Data.SQLite.EF6" />
|
||||
<remove invariant="System.Data.SQLite" /><add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".NET Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" /></DbProviderFactories>
|
||||
</system.data></configuration>
|
||||
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using System.Data.Entity;
|
||||
using Filtration.ObjectModel;
|
||||
|
||||
namespace Filtration.ItemFilterPreview.Data.DataContexts
|
||||
{
|
||||
public class FiltrationDbContext : DbContext
|
||||
{
|
||||
public FiltrationDbContext() : base("name=FiltrationDbContext")
|
||||
{
|
||||
// Disable database initializer
|
||||
Database.SetInitializer<FiltrationDbContext>(null);
|
||||
Database.Log = Console.WriteLine;
|
||||
}
|
||||
|
||||
public virtual DbSet<Item> Items { get; set; }
|
||||
public virtual DbSet<ItemSet> ItemSets { get; set; }
|
||||
|
||||
protected override void OnModelCreating(DbModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder.Entity<Item>()
|
||||
.Property(e => e.Description)
|
||||
.IsUnicode(false);
|
||||
|
||||
modelBuilder.Entity<Item>()
|
||||
.Property(e => e.BaseType)
|
||||
.IsUnicode(false);
|
||||
|
||||
modelBuilder.Entity<Item>()
|
||||
.Property(e => e.ItemClass)
|
||||
.IsUnicode(false);
|
||||
|
||||
modelBuilder.Entity<Item>()
|
||||
.Property(e => e.Sockets)
|
||||
.IsUnicode(false);
|
||||
|
||||
modelBuilder.Entity<ItemSet>()
|
||||
.Property(e => e.Name)
|
||||
.IsUnicode(false);
|
||||
|
||||
modelBuilder.Entity<ItemSet>()
|
||||
.HasMany(e => e.Items)
|
||||
.WithRequired(e => e.ItemSet)
|
||||
.WillCascadeOnDelete(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" 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>{855B38CC-EEF2-471D-BBBC-EB3E2FF3D387}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Filtration.ItemFilterPreview.Data</RootNamespace>
|
||||
<AssemblyName>Filtration.ItemFilterPreview.Data</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<TargetFrameworkProfile />
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<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' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Data.SQLite, Version=1.0.101.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Data.SQLite.Core.1.0.101.0\lib\net46\System.Data.SQLite.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.SQLite.EF6, Version=1.0.101.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Data.SQLite.EF6.1.0.101.0\lib\net46\System.Data.SQLite.EF6.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.SQLite.Linq, Version=1.0.101.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Data.SQLite.Linq.1.0.101.0\lib\net46\System.Data.SQLite.Linq.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.Security" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="DataContexts\FiltrationDbContext.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Repositories\IEntityRepository.cs" />
|
||||
<Compile Include="Repositories\ItemSetRepository.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Filtration.ObjectModel\Filtration.ObjectModel.csproj">
|
||||
<Project>{4aac3beb-1dc1-483e-9d11-0e9334e80227}</Project>
|
||||
<Name>Filtration.ObjectModel</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="..\packages\System.Data.SQLite.Core.1.0.101.0\build\net46\System.Data.SQLite.Core.targets" Condition="Exists('..\packages\System.Data.SQLite.Core.1.0.101.0\build\net46\System.Data.SQLite.Core.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\packages\System.Data.SQLite.Core.1.0.101.0\build\net46\System.Data.SQLite.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\System.Data.SQLite.Core.1.0.101.0\build\net46\System.Data.SQLite.Core.targets'))" />
|
||||
</Target>
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
36
Filtration.ItemFilterPreview.Data/Properties/AssemblyInfo.cs
Normal file
36
Filtration.ItemFilterPreview.Data/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Filtration.ItemFilterPreview.Data")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Filtration.ItemFilterPreview.Data")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2016")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("855b38cc-eef2-471d-bbbc-eb3e2ff3d387")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
|
||||
namespace Filtration.ItemFilterPreview.Data.Repositories
|
||||
{
|
||||
public interface IEntityRepository<T> : IDisposable
|
||||
{
|
||||
IQueryable<T> All { get; }
|
||||
IQueryable<T> AllIncluding(params Expression<Func<T, object>>[] includeProperties);
|
||||
T Find(int id);
|
||||
void InsertOrUpdate(T itemSet);
|
||||
void Delete(int id);
|
||||
void Save();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
using System;
|
||||
using System.Data.Entity;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using Filtration.ItemFilterPreview.Data.DataContexts;
|
||||
using Filtration.ObjectModel;
|
||||
|
||||
namespace Filtration.ItemFilterPreview.Data.Repositories
|
||||
{
|
||||
public class ItemSetRepository : IEntityRepository<ItemSet>
|
||||
{
|
||||
FiltrationDbContext _context = new FiltrationDbContext();
|
||||
|
||||
|
||||
public IQueryable<ItemSet> All => _context.ItemSets;
|
||||
|
||||
public IQueryable<ItemSet> AllIncluding(params Expression<Func<ItemSet, object>>[] includeProperties)
|
||||
{
|
||||
IQueryable<ItemSet> query = _context.ItemSets;
|
||||
foreach (var includeProperty in includeProperties)
|
||||
{
|
||||
query = query.Include(includeProperty);
|
||||
}
|
||||
|
||||
return query;
|
||||
}
|
||||
|
||||
public ItemSet Find(int id)
|
||||
{
|
||||
return _context.ItemSets.Find(id);
|
||||
}
|
||||
|
||||
public void InsertOrUpdate(ItemSet itemSet)
|
||||
{
|
||||
if (itemSet.Id == default(long))
|
||||
{
|
||||
// New entity
|
||||
_context.ItemSets.Add(itemSet);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Existing entity
|
||||
_context.Entry(itemSet).State = EntityState.Modified;
|
||||
}
|
||||
}
|
||||
|
||||
public void Delete(int id)
|
||||
{
|
||||
var itemSet = _context.ItemSets.Find(id);
|
||||
_context.ItemSets.Remove(itemSet);
|
||||
}
|
||||
|
||||
public void Save()
|
||||
{
|
||||
_context.SaveChanges();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_context.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
8
Filtration.ItemFilterPreview.Data/packages.config
Normal file
8
Filtration.ItemFilterPreview.Data/packages.config
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="EntityFramework" version="6.1.3" targetFramework="net46" />
|
||||
<package id="System.Data.SQLite" version="1.0.101.0" targetFramework="net461" />
|
||||
<package id="System.Data.SQLite.Core" version="1.0.101.0" targetFramework="net461" />
|
||||
<package id="System.Data.SQLite.EF6" version="1.0.101.0" targetFramework="net461" />
|
||||
<package id="System.Data.SQLite.Linq" version="1.0.101.0" targetFramework="net461" />
|
||||
</packages>
|
||||
Reference in New Issue
Block a user