remove old project
This commit is contained in:
@@ -1,109 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\packages\MSTest.TestAdapter.1.4.0\build\net45\MSTest.TestAdapter.props" Condition="Exists('..\packages\MSTest.TestAdapter.1.4.0\build\net45\MSTest.TestAdapter.props')" />
|
||||
<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>{52BDCA0E-DC33-4398-BB6F-485CB07DE980}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>API.Client.Test</RootNamespace>
|
||||
<AssemblyName>API.Client.Test</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">15.0</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
|
||||
<IsCodedUITest>False</IsCodedUITest>
|
||||
<TestProjectType>UnitTest</TestProjectType>
|
||||
<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="Microsoft.Data.Edm, Version=5.8.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Data.Edm.5.8.4\lib\net40\Microsoft.Data.Edm.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Data.OData, Version=5.8.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Data.OData.5.8.4\lib\net40\Microsoft.Data.OData.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.OData.Core, Version=7.5.4.30215, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.OData.Core.7.5.4\lib\portable-net45+win8+wpa81\Microsoft.OData.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.OData.Edm, Version=7.5.4.30215, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.OData.Edm.7.5.4\lib\portable-net45+win8+wpa81\Microsoft.OData.Edm.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Spatial, Version=7.5.4.30215, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Spatial.7.5.4\lib\portable-net45+win8+wpa81\Microsoft.Spatial.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MSTest.TestFramework.1.4.0\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MSTest.TestFramework.1.4.0\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Simple.OData.Client.Core, Version=5.6.2.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Simple.OData.Client.5.6.2\lib\net452\Simple.OData.Client.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Simple.OData.Client.Dynamic, Version=5.6.2.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Simple.OData.Client.5.6.2\lib\net452\Simple.OData.Client.Dynamic.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Simple.OData.Client.V3.Adapter, Version=5.6.2.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Simple.OData.Client.5.6.2\lib\net452\Simple.OData.Client.V3.Adapter.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Simple.OData.Client.V4.Adapter, Version=5.6.2.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Simple.OData.Client.5.6.2\lib\net452\Simple.OData.Client.V4.Adapter.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Spatial, Version=5.8.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Spatial.5.8.4\lib\net40\System.Spatial.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="OdataTests.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\API.Client\API.Client.csproj">
|
||||
<Project>{88db6691-8ee1-428c-8da4-50342aeb2c54}</Project>
|
||||
<Name>API.Client</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Models\API.Models.csproj">
|
||||
<Project>{8d72ff7d-c085-4c06-9d66-9537b7ac924d}</Project>
|
||||
<Name>API.Models</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.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\MSTest.TestAdapter.1.4.0\build\net45\MSTest.TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.1.4.0\build\net45\MSTest.TestAdapter.props'))" />
|
||||
<Error Condition="!Exists('..\packages\MSTest.TestAdapter.1.4.0\build\net45\MSTest.TestAdapter.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.1.4.0\build\net45\MSTest.TestAdapter.targets'))" />
|
||||
</Target>
|
||||
<Import Project="..\packages\MSTest.TestAdapter.1.4.0\build\net45\MSTest.TestAdapter.targets" Condition="Exists('..\packages\MSTest.TestAdapter.1.4.0\build\net45\MSTest.TestAdapter.targets')" />
|
||||
</Project>
|
||||
@@ -1,24 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<appSettings>
|
||||
<!--<add key="url" value="http://localhost/API" />-->
|
||||
<add key="url" value="http://test.benjamin-ifland.de"/>
|
||||
</appSettings>
|
||||
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.OData.Core" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-7.5.4.30215" newVersion="7.5.4.30215" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.OData.Edm" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-7.5.4.30215" newVersion="7.5.4.30215" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.Spatial" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-7.5.4.30215" newVersion="7.5.4.30215" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
@@ -1,122 +0,0 @@
|
||||
using API.Models;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using Simple.OData.Client;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Threading.Tasks;
|
||||
using File = System.IO.File;
|
||||
|
||||
namespace API.Client.Test {
|
||||
[TestClass]
|
||||
public class OdataTests {
|
||||
|
||||
private const string TEST_CASE_IDENTIFIER = "TESTCASE";
|
||||
private static Song testSong;
|
||||
|
||||
|
||||
[ClassInitialize]
|
||||
public static async Task TestInitialize(TestContext tc) {
|
||||
var client = new Client();
|
||||
var newSong = new Song {
|
||||
Name = Guid.NewGuid().ToString(),
|
||||
Text = TEST_CASE_IDENTIFIER
|
||||
};
|
||||
|
||||
testSong = await client.Post(newSong);
|
||||
}
|
||||
|
||||
[ClassCleanup]
|
||||
public static async Task ClassCleanup() {
|
||||
var client = new Client();
|
||||
var itemsToDelete = await client.Get(_ => _.Text == TEST_CASE_IDENTIFIER);
|
||||
foreach (var item in itemsToDelete) {
|
||||
await client.Delete(item.ID);
|
||||
}
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public async Task GetList() {
|
||||
var client = new Client();
|
||||
var data = await client.Get();
|
||||
|
||||
Assert.IsTrue(data.Any(_ => _.ID == testSong.ID));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public async Task GetItem() {
|
||||
var client = new Client();
|
||||
var item = await client.Get(testSong.ID);
|
||||
|
||||
Assert.AreEqual(testSong.Name, item.Name);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public async Task PostItem() {
|
||||
var client = new Client();
|
||||
var newSong = new Song {
|
||||
Name = Guid.NewGuid().ToString(),
|
||||
Text = TEST_CASE_IDENTIFIER
|
||||
};
|
||||
|
||||
var response = await client.Post(newSong);
|
||||
var insertedSong = await client.Get(response.ID);
|
||||
|
||||
Assert.AreEqual(newSong.Name, insertedSong.Name);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public async Task PatchItem() {
|
||||
var client = new Client();
|
||||
var newSong = new Song {
|
||||
Name = Guid.NewGuid().ToString(),
|
||||
Text = TEST_CASE_IDENTIFIER,
|
||||
Comments = "Item to Patch"
|
||||
};
|
||||
|
||||
var response = await client.Post(newSong);
|
||||
try {
|
||||
var patchedSong = await client.Patch(response.ID, new { Comments = "patched" });
|
||||
} catch (WebRequestException ex) {
|
||||
File.WriteAllText("error.html", ex.Response);
|
||||
throw;
|
||||
}
|
||||
var insertedSong = await client.Get(response.ID);
|
||||
|
||||
Assert.AreEqual("patched", insertedSong.Comments);
|
||||
Assert.AreEqual(newSong.Name, insertedSong.Name);
|
||||
Assert.AreEqual(TEST_CASE_IDENTIFIER, insertedSong.Text);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public async Task DeleteItem() {
|
||||
var client = new Client();
|
||||
var newSong = new Song {
|
||||
Name = Guid.NewGuid().ToString(),
|
||||
Text = TEST_CASE_IDENTIFIER
|
||||
};
|
||||
|
||||
var response = await client.Post(newSong);
|
||||
var insertedSong = await client.Get(response.ID);
|
||||
Assert.AreEqual(newSong.Name, insertedSong.Name);
|
||||
try {
|
||||
|
||||
var count = await client.Delete(response.ID);
|
||||
Assert.AreEqual(1, count);
|
||||
} catch (WebRequestException ex) {
|
||||
File.WriteAllText("error.html", ex.Response);
|
||||
throw;
|
||||
}
|
||||
|
||||
try {
|
||||
await client.Get(response.ID);
|
||||
Assert.Fail("WebRequestException not thrown");
|
||||
} catch (WebRequestException ex) {
|
||||
Assert.AreEqual(HttpStatusCode.NotFound, ex.Code);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
[assembly: AssemblyTitle("API.Client.Test")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("API.Client.Test")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2019")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
[assembly: Guid("52bdca0e-dc33-4398-bb6f-485cb07de980")]
|
||||
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Microsoft.Data.Edm" version="5.8.4" targetFramework="net462" />
|
||||
<package id="Microsoft.Data.OData" version="5.8.4" targetFramework="net462" />
|
||||
<package id="Microsoft.OData.Core" version="7.5.4" targetFramework="net462" />
|
||||
<package id="Microsoft.OData.Edm" version="7.5.4" targetFramework="net462" />
|
||||
<package id="Microsoft.Spatial" version="7.5.4" targetFramework="net462" />
|
||||
<package id="MSTest.TestAdapter" version="1.4.0" targetFramework="net462" />
|
||||
<package id="MSTest.TestFramework" version="1.4.0" targetFramework="net462" />
|
||||
<package id="Simple.OData.Client" version="5.6.2" targetFramework="net462" />
|
||||
<package id="System.Spatial" version="5.8.4" targetFramework="net462" />
|
||||
</packages>
|
||||
@@ -1,93 +0,0 @@
|
||||
<?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>{88DB6691-8EE1-428C-8DA4-50342AEB2C54}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>API.Client</RootNamespace>
|
||||
<AssemblyName>API.Client</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<Deterministic>true</Deterministic>
|
||||
</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="Microsoft.Data.Edm, Version=5.8.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Data.Edm.5.8.4\lib\net40\Microsoft.Data.Edm.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Data.OData, Version=5.8.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Data.OData.5.8.4\lib\net40\Microsoft.Data.OData.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.OData.Core, Version=7.5.4.30215, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.OData.Core.7.5.4\lib\portable-net45+win8+wpa81\Microsoft.OData.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.OData.Edm, Version=7.5.4.30215, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.OData.Edm.7.5.4\lib\portable-net45+win8+wpa81\Microsoft.OData.Edm.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Spatial, Version=7.5.4.30215, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Spatial.7.5.4\lib\portable-net45+win8+wpa81\Microsoft.Spatial.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Simple.OData.Client.Core, Version=5.6.2.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Simple.OData.Client.5.6.2\lib\net452\Simple.OData.Client.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Simple.OData.Client.Dynamic, Version=5.6.2.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Simple.OData.Client.5.6.2\lib\net452\Simple.OData.Client.Dynamic.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Simple.OData.Client.V3.Adapter, Version=5.6.2.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Simple.OData.Client.5.6.2\lib\net452\Simple.OData.Client.V3.Adapter.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Simple.OData.Client.V4.Adapter, Version=5.6.2.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Simple.OData.Client.5.6.2\lib\net452\Simple.OData.Client.V4.Adapter.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Spatial, Version=5.8.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Spatial.5.8.4\lib\net40\System.Spatial.dll</HintPath>
|
||||
</Reference>
|
||||
<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="Client.cs" />
|
||||
<Compile Include="Expresseion.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<WCFMetadata Include="Connected Services\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Models\API.Models.csproj">
|
||||
<Project>{8d72ff7d-c085-4c06-9d66-9537b7ac924d}</Project>
|
||||
<Name>API.Models</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
@@ -1,52 +0,0 @@
|
||||
|
||||
using API.Models;
|
||||
using Simple.OData.Client;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Linq.Expressions;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace API.Client {
|
||||
public class Client {
|
||||
private static string url = ConfigurationManager.AppSettings["url"] + "/odata";
|
||||
|
||||
public async Task<IEnumerable<Song>> Get() {
|
||||
var client = new ODataClient(url).For<Song>();
|
||||
var songs = await client.FindEntriesAsync();
|
||||
return songs;
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<Song>> Get(Expression<Func<Song, bool>> filterExpression) {
|
||||
var client = new ODataClient(url).For<Song>();
|
||||
var songs = await client.Filter(filterExpression).FindEntriesAsync();
|
||||
return songs;
|
||||
}
|
||||
|
||||
public async Task<Song> Get(long id) {
|
||||
var client = new ODataClient(url).For<Song>();
|
||||
var song = await client.Key(id).FindEntryAsync();
|
||||
return song;
|
||||
}
|
||||
|
||||
public async Task<Song> Post(Song song) {
|
||||
var client = new ODataClient(url).For<Song>();
|
||||
var insertedSong = await client.Set(song).InsertEntryAsync();
|
||||
return insertedSong;
|
||||
}
|
||||
|
||||
public async Task<Song> Patch(long id, object value) {
|
||||
var client = new ODataClient(url).For<Song>().Key(id);
|
||||
var insertedSong = await client.Set(value).UpdateEntryAsync();
|
||||
return insertedSong;
|
||||
}
|
||||
|
||||
public async Task<int> Delete(long id) {
|
||||
var client = new ODataClient(url).For<Song>();
|
||||
var count = await client.Key(id).DeleteEntriesAsync();
|
||||
return count;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
namespace API.Client {
|
||||
public class Expression {
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
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("API.Client")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("API.Client")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2019")]
|
||||
[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("88db6691-8ee1-428c-8da4-50342aeb2c54")]
|
||||
|
||||
// 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")]
|
||||
@@ -1,19 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.OData.Core" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-7.5.4.30215" newVersion="7.5.4.30215" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.OData.Edm" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-7.5.4.30215" newVersion="7.5.4.30215" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.Spatial" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-7.5.4.30215" newVersion="7.5.4.30215" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
@@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Microsoft.Data.Edm" version="5.8.4" targetFramework="net462" />
|
||||
<package id="Microsoft.Data.OData" version="5.8.4" targetFramework="net462" />
|
||||
<package id="Microsoft.OData.Core" version="7.5.4" targetFramework="net462" />
|
||||
<package id="Microsoft.OData.Edm" version="7.5.4" targetFramework="net462" />
|
||||
<package id="Microsoft.Spatial" version="7.5.4" targetFramework="net462" />
|
||||
<package id="Simple.OData.Client" version="5.6.2" targetFramework="net462" />
|
||||
<package id="System.Spatial" version="5.8.4" targetFramework="net462" />
|
||||
</packages>
|
||||
@@ -1,77 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\packages\MSTest.TestAdapter.1.4.0\build\net45\MSTest.TestAdapter.props" Condition="Exists('..\packages\MSTest.TestAdapter.1.4.0\build\net45\MSTest.TestAdapter.props')" />
|
||||
<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>{84714616-89D7-4A5D-86D8-2DC395530FEB}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>API.Test</RootNamespace>
|
||||
<AssemblyName>API.Test</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">15.0</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
|
||||
<IsCodedUITest>False</IsCodedUITest>
|
||||
<TestProjectType>UnitTest</TestProjectType>
|
||||
<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.2.0\lib\net45\EntityFramework.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MSTest.TestFramework.1.4.0\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MSTest.TestFramework.1.4.0\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Data" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="UnitTest1.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.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\MSTest.TestAdapter.1.4.0\build\net45\MSTest.TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.1.4.0\build\net45\MSTest.TestAdapter.props'))" />
|
||||
<Error Condition="!Exists('..\packages\MSTest.TestAdapter.1.4.0\build\net45\MSTest.TestAdapter.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.1.4.0\build\net45\MSTest.TestAdapter.targets'))" />
|
||||
</Target>
|
||||
<Import Project="..\packages\MSTest.TestAdapter.1.4.0\build\net45\MSTest.TestAdapter.targets" Condition="Exists('..\packages\MSTest.TestAdapter.1.4.0\build\net45\MSTest.TestAdapter.targets')" />
|
||||
</Project>
|
||||
@@ -1,13 +0,0 @@
|
||||
<?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.SqlConnectionFactory, EntityFramework" />
|
||||
<providers>
|
||||
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
|
||||
</providers>
|
||||
</entityFramework>
|
||||
</configuration>
|
||||
@@ -1,20 +0,0 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
[assembly: AssemblyTitle("API.Test")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("API.Test")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2019")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
[assembly: Guid("84714616-89d7-4a5d-86d8-2dc395530feb")]
|
||||
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -1,43 +0,0 @@
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using System;
|
||||
using System.Data.Entity.Core.EntityClient;
|
||||
using System.Data.SqlClient;
|
||||
|
||||
namespace API.Test {
|
||||
[TestClass]
|
||||
public class SqlConnectionBuilder {
|
||||
[TestMethod]
|
||||
public void Build() {
|
||||
var serverName = "localhost\\SQLEXPRESS";
|
||||
var databaseName = "wgenerator";
|
||||
var user = "sa";
|
||||
var pass = "sa";
|
||||
|
||||
// Initialize the connection string builder for the
|
||||
// underlying provider.
|
||||
var sqlBuilder =
|
||||
new SqlConnectionStringBuilder {
|
||||
|
||||
// Set the properties for the data source.
|
||||
DataSource = serverName,
|
||||
InitialCatalog = databaseName,
|
||||
IntegratedSecurity = true,
|
||||
UserID= user,
|
||||
Password = pass,
|
||||
};
|
||||
|
||||
// Build the SqlConnection connection string.
|
||||
var providerString = sqlBuilder.ToString();
|
||||
|
||||
|
||||
Console.WriteLine(providerString.ToString());
|
||||
|
||||
using (var conn =
|
||||
new SqlConnection(providerString.ToString())) {
|
||||
conn.Open();
|
||||
Console.WriteLine("Just testing the connection.");
|
||||
conn.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="EntityFramework" version="6.2.0" targetFramework="net462" />
|
||||
<package id="MSTest.TestAdapter" version="1.4.0" targetFramework="net462" />
|
||||
<package id="MSTest.TestFramework" version="1.4.0" targetFramework="net462" />
|
||||
</packages>
|
||||
71
API/API.sln
71
API/API.sln
@@ -1,71 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.28307.489
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "API", "API\API.csproj", "{27056FE2-5A34-44B2-9196-6F19C04F27CC}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "API.Test", "API.Test\API.Test.csproj", "{84714616-89D7-4A5D-86D8-2DC395530FEB}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Backend", "Backend", "{5DD4FA9B-976C-4CDB-9E73-CF3485DBDD72}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "API.Client", "API.Client\API.Client.csproj", "{88DB6691-8EE1-428C-8DA4-50342AEB2C54}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "API.Client.Test", "API.Client.Test\API.Client.Test.csproj", "{52BDCA0E-DC33-4398-BB6F-485CB07DE980}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Client", "Client", "{D89C3FFE-4990-4B35-977C-727F89D7D05E}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Shared", "Shared", "{E1B05E83-7E28-47D6-9DB5-3C1B2293AA92}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "API.Models", "Models\API.Models.csproj", "{8D72FF7D-C085-4C06-9D66-9537B7AC924D}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{0298B379-812E-45C9-BC84-744BC848D2E5}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Migration", "Migration\Migration.csproj", "{48EBC2B8-5256-44BC-8A39-3A3C8C388BC6}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{27056FE2-5A34-44B2-9196-6F19C04F27CC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{27056FE2-5A34-44B2-9196-6F19C04F27CC}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{27056FE2-5A34-44B2-9196-6F19C04F27CC}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{27056FE2-5A34-44B2-9196-6F19C04F27CC}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{84714616-89D7-4A5D-86D8-2DC395530FEB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{84714616-89D7-4A5D-86D8-2DC395530FEB}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{84714616-89D7-4A5D-86D8-2DC395530FEB}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{84714616-89D7-4A5D-86D8-2DC395530FEB}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{88DB6691-8EE1-428C-8DA4-50342AEB2C54}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{88DB6691-8EE1-428C-8DA4-50342AEB2C54}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{88DB6691-8EE1-428C-8DA4-50342AEB2C54}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{88DB6691-8EE1-428C-8DA4-50342AEB2C54}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{52BDCA0E-DC33-4398-BB6F-485CB07DE980}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{52BDCA0E-DC33-4398-BB6F-485CB07DE980}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{52BDCA0E-DC33-4398-BB6F-485CB07DE980}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{52BDCA0E-DC33-4398-BB6F-485CB07DE980}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{8D72FF7D-C085-4C06-9D66-9537B7AC924D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{8D72FF7D-C085-4C06-9D66-9537B7AC924D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{8D72FF7D-C085-4C06-9D66-9537B7AC924D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{8D72FF7D-C085-4C06-9D66-9537B7AC924D}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{48EBC2B8-5256-44BC-8A39-3A3C8C388BC6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{48EBC2B8-5256-44BC-8A39-3A3C8C388BC6}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{48EBC2B8-5256-44BC-8A39-3A3C8C388BC6}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{48EBC2B8-5256-44BC-8A39-3A3C8C388BC6}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{27056FE2-5A34-44B2-9196-6F19C04F27CC} = {5DD4FA9B-976C-4CDB-9E73-CF3485DBDD72}
|
||||
{84714616-89D7-4A5D-86D8-2DC395530FEB} = {5DD4FA9B-976C-4CDB-9E73-CF3485DBDD72}
|
||||
{88DB6691-8EE1-428C-8DA4-50342AEB2C54} = {D89C3FFE-4990-4B35-977C-727F89D7D05E}
|
||||
{52BDCA0E-DC33-4398-BB6F-485CB07DE980} = {D89C3FFE-4990-4B35-977C-727F89D7D05E}
|
||||
{8D72FF7D-C085-4C06-9D66-9537B7AC924D} = {E1B05E83-7E28-47D6-9DB5-3C1B2293AA92}
|
||||
{48EBC2B8-5256-44BC-8A39-3A3C8C388BC6} = {0298B379-812E-45C9-BC84-744BC848D2E5}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {27650156-7B3F-4C0C-83D3-D13119DE083F}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -1,233 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.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>
|
||||
<ProductVersion>
|
||||
</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{27056FE2-5A34-44B2-9196-6F19C04F27CC}</ProjectGuid>
|
||||
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>API</RootNamespace>
|
||||
<AssemblyName>API</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
|
||||
<MvcBuildViews>false</MvcBuildViews>
|
||||
<UseIISExpress>false</UseIISExpress>
|
||||
<Use64BitIISExpress />
|
||||
<IISExpressSSLPort />
|
||||
<IISExpressAnonymousAuthentication />
|
||||
<IISExpressWindowsAuthentication />
|
||||
<IISExpressUseClassicPipelineMode />
|
||||
<UseGlobalApplicationHostFile />
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Autofac, Version=4.9.1.0, Culture=neutral, PublicKeyToken=17863af14b0044da, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Autofac.4.9.1\lib\net45\Autofac.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Autofac.Integration.WebApi, Version=4.2.0.0, Culture=neutral, PublicKeyToken=17863af14b0044da, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Autofac.WebApi2.4.2.0\lib\net45\Autofac.Integration.WebApi.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.AspNet.OData, Version=7.1.0.21120, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.AspNet.OData.7.1.0\lib\net45\Microsoft.AspNet.OData.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="Microsoft.Extensions.DependencyInjection, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.DependencyInjection.2.2.0\lib\net461\Microsoft.Extensions.DependencyInjection.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Extensions.DependencyInjection.Abstractions, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.2.0\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.OData.Core, Version=7.5.4.30215, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.OData.Core.7.5.4\lib\portable-net45+win8+wpa81\Microsoft.OData.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.OData.Edm, Version=7.5.4.30215, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.OData.Edm.7.5.4\lib\portable-net45+win8+wpa81\Microsoft.OData.Edm.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Spatial, Version=7.5.4.30215, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Spatial.7.5.4\lib\portable-net45+win8+wpa81\Microsoft.Spatial.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Net.Http.Formatting, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebApi.Client.5.2.7\lib\net45\System.Net.Http.Formatting.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Reflection, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Reflection.4.3.0\lib\net462\System.Reflection.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.Extensions, Version=4.1.1.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Runtime.Extensions.4.3.1\lib\net462\System.Runtime.Extensions.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Cors, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.AspNet.Cors.5.2.7\lib\net45\System.Web.Cors.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Entity" />
|
||||
<Reference Include="System.Web.ApplicationServices" />
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Web.Http, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebApi.Core.5.2.7\lib\net45\System.Web.Http.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Http.Cors, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebApi.Cors.5.2.7\lib\net45\System.Web.Http.Cors.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Http.WebHost, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebApi.WebHost.5.2.7\lib\net45\System.Web.Http.WebHost.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Web" />
|
||||
<Reference Include="System.Web.Abstractions" />
|
||||
<Reference Include="System.Web.Routing" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.Net.Http">
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Http.WebRequest">
|
||||
</Reference>
|
||||
<Reference Include="WebGrease">
|
||||
<Private>True</Private>
|
||||
<HintPath>..\packages\WebGrease.1.6.0\lib\WebGrease.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Antlr3.Runtime">
|
||||
<Private>True</Private>
|
||||
<HintPath>..\packages\Antlr.3.5.0.2\lib\Antlr3.Runtime.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="App_Start\DependencyInjectionConfig.cs" />
|
||||
<Compile Include="App_Start\EnvironmentConfig.cs" />
|
||||
<Compile Include="App_Start\WebApiConfig.cs" />
|
||||
<Compile Include="Controllers\FilesController.cs" />
|
||||
<Compile Include="Controllers\SongsController.cs" />
|
||||
<Compile Include="Database\DataContext.cs" />
|
||||
<Compile Include="Global.asax.cs">
|
||||
<DependentUpon>Global.asax</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Migrations\201903161558469_Init.cs" />
|
||||
<Compile Include="Migrations\201903161558469_Init.Designer.cs">
|
||||
<DependentUpon>201903161558469_Init.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Migrations\201903172015115_SongNumber.cs" />
|
||||
<Compile Include="Migrations\201903172015115_SongNumber.Designer.cs">
|
||||
<DependentUpon>201903172015115_SongNumber.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Migrations\201903172028249_Log.cs" />
|
||||
<Compile Include="Migrations\201903172028249_Log.Designer.cs">
|
||||
<DependentUpon>201903172028249_Log.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Migrations\Configuration.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Services\FileGarbageCollectionService.cs" />
|
||||
<Compile Include="Services\FileService.cs" />
|
||||
<Compile Include="Services\Logger.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="favicon.ico" />
|
||||
<Content Include="Global.asax" />
|
||||
<Content Include="Web.config">
|
||||
<SubType>Designer</SubType>
|
||||
</Content>
|
||||
<Content Include="Web.Debug.config">
|
||||
<DependentUpon>Web.config</DependentUpon>
|
||||
</Content>
|
||||
<Content Include="Web.Release.config">
|
||||
<DependentUpon>Web.config</DependentUpon>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Models\API.Models.csproj">
|
||||
<Project>{8d72ff7d-c085-4c06-9d66-9537b7ac924d}</Project>
|
||||
<Name>API.Models</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
<None Include="Properties\PublishProfiles\deploy to test.pubxml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Migrations\201903161558469_Init.resx">
|
||||
<DependentUpon>201903161558469_Init.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Migrations\201903172015115_SongNumber.resx">
|
||||
<DependentUpon>201903172015115_SongNumber.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Migrations\201903172028249_Log.resx">
|
||||
<DependentUpon>201903172028249_Log.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="App_Data\" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
|
||||
<Target Name="MvcBuildViews" AfterTargets="AfterBuild" Condition="'$(MvcBuildViews)'=='true'">
|
||||
<AspNetCompiler VirtualPath="temp" PhysicalPath="$(WebProjectOutputDir)" />
|
||||
</Target>
|
||||
<ProjectExtensions>
|
||||
<VisualStudio>
|
||||
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
|
||||
<WebProjectProperties>
|
||||
<UseIIS>True</UseIIS>
|
||||
<AutoAssignPort>True</AutoAssignPort>
|
||||
<DevelopmentServerPort>50752</DevelopmentServerPort>
|
||||
<DevelopmentServerVPath>/</DevelopmentServerVPath>
|
||||
<IISUrl>http://localhost/API</IISUrl>
|
||||
<NTLMAuthentication>False</NTLMAuthentication>
|
||||
<UseCustomServer>False</UseCustomServer>
|
||||
<CustomServerUrl>
|
||||
</CustomServerUrl>
|
||||
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
|
||||
</WebProjectProperties>
|
||||
</FlavorProperties>
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
<!-- 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>
|
||||
@@ -1,44 +0,0 @@
|
||||
using API.Controllers;
|
||||
using API.Database;
|
||||
using API.Services;
|
||||
using Autofac;
|
||||
using Autofac.Integration.WebApi;
|
||||
using ProductService.Controllers;
|
||||
using System.Web.Http;
|
||||
|
||||
namespace API.App_Start {
|
||||
/// <remarks>
|
||||
/// https://autofaccn.readthedocs.io/en/latest/integration/webapi.html#quick-start
|
||||
/// </remarks>
|
||||
public static class DependencyInjectionConfig {
|
||||
public static void RegisterDependecyInjection(this HttpConfiguration config) {
|
||||
var builder = new ContainerBuilder();
|
||||
builder.RegisterControllers();
|
||||
builder.RegisterWebApiFilterProvider(config);
|
||||
builder.RegisterWebApiModelBinderProvider();
|
||||
|
||||
builder.RegisterServices();
|
||||
builder.RegisterDataProvider();
|
||||
|
||||
var container = builder.Build();
|
||||
config.DependencyResolver = new AutofacWebApiDependencyResolver(container);
|
||||
}
|
||||
|
||||
private static void RegisterControllers(this ContainerBuilder builder) {
|
||||
builder.RegisterType<SongsController>().InstancePerRequest();
|
||||
builder.RegisterType<FilesController>().InstancePerRequest();
|
||||
}
|
||||
|
||||
private static void RegisterServices(this ContainerBuilder builder) {
|
||||
builder.RegisterType<Logger>();
|
||||
|
||||
builder.RegisterType<FileService>().As<IFileService>().SingleInstance();
|
||||
builder.RegisterType<FileGarbageCollectionService>().As<IFileGarbageCollectionService>();
|
||||
}
|
||||
|
||||
private static void RegisterDataProvider(this ContainerBuilder builder) {
|
||||
builder.RegisterType<DataContext>().InstancePerRequest();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
using Newtonsoft.Json;
|
||||
using System.IO;
|
||||
|
||||
namespace API.App_Start {
|
||||
public static class EnvironmentConfig {
|
||||
public static Config Read() {
|
||||
var path = System.Web.Hosting.HostingEnvironment.MapPath(@"~/App_Data");
|
||||
var jsonFile = Path.Combine(path, "environment.json");
|
||||
if (!File.Exists(jsonFile)) return null;
|
||||
|
||||
var file = File.ReadAllText(jsonFile);
|
||||
return JsonConvert.DeserializeObject<Config>(file);
|
||||
}
|
||||
}
|
||||
|
||||
public class Config {
|
||||
public string ConnectionString { get; set; }
|
||||
public string CorsUrls { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
using API.App_Start;
|
||||
using API.Models;
|
||||
using Microsoft.AspNet.OData.Builder;
|
||||
using Microsoft.AspNet.OData.Extensions;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Web.Http;
|
||||
using System.Web.Http.Cors;
|
||||
|
||||
namespace API {
|
||||
public static class WebApiConfig {
|
||||
public static void Register(HttpConfiguration config) {
|
||||
|
||||
// CORS
|
||||
var cors = new EnableCorsAttribute(EnvironmentConfig.Read()?.CorsUrls ?? "http://localhost:4200", "*", "*") {
|
||||
SupportsCredentials = true
|
||||
};
|
||||
config.EnableCors(cors);
|
||||
|
||||
// Web API configuration and services
|
||||
config.Formatters.JsonFormatter.SupportedMediaTypes.Add(new MediaTypeHeaderValue("text/html"));
|
||||
|
||||
// Web API routes
|
||||
config.MapHttpAttributeRoutes();
|
||||
config.Routes.MapHttpRoute(
|
||||
name: "DefaultApi",
|
||||
routeTemplate: "api/{controller}/{id}",
|
||||
defaults: new { id = RouteParameter.Optional }
|
||||
);
|
||||
|
||||
// Web API oData configuration
|
||||
var builder = new ODataConventionModelBuilder();
|
||||
builder.EntitySet<Song>("songs");
|
||||
config.Count().Filter().OrderBy().Expand().Select().MaxTop(null);
|
||||
config.MapODataServiceRoute(
|
||||
routeName: "songs",
|
||||
routePrefix: "odata",
|
||||
model: builder.GetEdmModel());
|
||||
|
||||
config.RegisterDependecyInjection();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,107 +0,0 @@
|
||||
using API.Database;
|
||||
using API.Models;
|
||||
using API.Services;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
using System.Web.Http;
|
||||
|
||||
namespace API.Controllers {
|
||||
public class FilesController : ApiController {
|
||||
private readonly DataContext dataContext;
|
||||
private readonly IFileService fileService;
|
||||
private readonly IFileGarbageCollectionService fileGarbageCollectionService;
|
||||
private readonly string dataPath;
|
||||
|
||||
public FilesController(
|
||||
DataContext dataContext,
|
||||
IFileService fileService,
|
||||
IFileGarbageCollectionService fileGarbageCollectionService
|
||||
) {
|
||||
this.dataContext = dataContext;
|
||||
this.fileService = fileService;
|
||||
this.fileGarbageCollectionService = fileGarbageCollectionService;
|
||||
dataPath = System.Web.Hosting.HostingEnvironment.MapPath(@"~/App_Data");
|
||||
}
|
||||
|
||||
// GET: api/Files/5
|
||||
[Route("api/songs/{songId}/files/{fileId}", Order = 1)]
|
||||
public async Task<HttpResponseMessage> Get(long songId, long fileId) {
|
||||
var response = new HttpResponseMessage(HttpStatusCode.OK);
|
||||
fileGarbageCollectionService.Collect(dataPath);
|
||||
|
||||
var file = await dataContext.Files.FindAsync(fileId);
|
||||
if (file == null || file.Song.ID != songId) return new HttpResponseMessage(HttpStatusCode.NotFound);
|
||||
var reference = file.ReferenceFile;
|
||||
|
||||
var stream = fileService.Load(dataPath, reference.ToString());
|
||||
response.Content = new StreamContent(stream);
|
||||
response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream");
|
||||
return response;
|
||||
}
|
||||
|
||||
// POST: api/Files
|
||||
[Route("api/songs/{songId}/files")]
|
||||
public async Task<HttpResponseMessage> Post(long songId, CancellationToken c) {
|
||||
fileGarbageCollectionService.Collect(dataPath);
|
||||
|
||||
// get file from network input
|
||||
var files = HttpContext.Current.Request.Files;
|
||||
if (files.Count != 1) return new HttpResponseMessage(HttpStatusCode.BadRequest);
|
||||
var file = HttpContext.Current.Request.Files[0];
|
||||
|
||||
// find song in database
|
||||
var song = dataContext.Songs.Find(songId);
|
||||
if (song == null) return new HttpResponseMessage(HttpStatusCode.NotFound);
|
||||
|
||||
// save file in App_Data
|
||||
var stream = file.InputStream;
|
||||
var filename = await fileService.Save(stream, dataPath, c);
|
||||
|
||||
// attach file reference to song
|
||||
song.Files.Add(new File {
|
||||
Name = file.FileName,
|
||||
ReferenceFile = filename
|
||||
});
|
||||
await dataContext.SaveChangesAsync(c);
|
||||
|
||||
return new HttpResponseMessage(HttpStatusCode.OK);
|
||||
}
|
||||
|
||||
[Route("api/songs/{songId}/files/{fileId}/edit"), HttpGet]
|
||||
public async Task<HttpResponseMessage> Edit(long songId, long fileId, string Name, FileType FileType, CancellationToken c) {
|
||||
var file = await dataContext.Files.FindAsync(fileId);
|
||||
if (file == null || file.Song.ID != songId) return new HttpResponseMessage(HttpStatusCode.NotFound);
|
||||
|
||||
file.Name = Name;
|
||||
file.FileType = FileType;
|
||||
await dataContext.SaveChangesAsync();
|
||||
|
||||
return new HttpResponseMessage(HttpStatusCode.OK);
|
||||
}
|
||||
|
||||
[Route("api/songs/{songId}/files/{fileId}/delete"), HttpGet]
|
||||
public async Task<HttpResponseMessage> Delete(long songId, long fileId, CancellationToken c) {
|
||||
var file = await dataContext.Files.FindAsync(fileId);
|
||||
if (file == null || file.Song.ID != songId) return new HttpResponseMessage(HttpStatusCode.NotFound);
|
||||
|
||||
dataContext.Files.Remove(file);
|
||||
await dataContext.SaveChangesAsync();
|
||||
fileGarbageCollectionService.Collect(dataPath);
|
||||
|
||||
return new HttpResponseMessage(HttpStatusCode.OK);
|
||||
}
|
||||
|
||||
|
||||
//// PUT: api/Files/5
|
||||
//public void Put(int id, [FromBody]string value) {
|
||||
//}
|
||||
|
||||
//// DELETE: api/Files/5
|
||||
//public void Delete(int id) {
|
||||
//}
|
||||
}
|
||||
}
|
||||
@@ -1,101 +0,0 @@
|
||||
using API.Database;
|
||||
using API.Models;
|
||||
using API.Services;
|
||||
using Microsoft.AspNet.OData;
|
||||
using System.Data.Entity;
|
||||
using System.Data.Entity.Infrastructure;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web.Http;
|
||||
namespace ProductService.Controllers {
|
||||
public class SongsController : ODataController {
|
||||
|
||||
public SongsController(
|
||||
DataContext db,
|
||||
Logger logger
|
||||
) {
|
||||
this.db = db;
|
||||
this.logger = logger;
|
||||
}
|
||||
|
||||
private readonly DataContext db;
|
||||
private readonly Logger logger;
|
||||
|
||||
private bool ProductExists(int key) {
|
||||
logger.Log($"{nameof(SongsController)}.{nameof(ProductExists)}({key})");
|
||||
return db.Songs.Any(p => p.ID == key);
|
||||
}
|
||||
|
||||
[EnableQuery]
|
||||
public IQueryable<Song> Get() {
|
||||
logger.Log($"{nameof(SongsController)}.{nameof(Get)}()");
|
||||
return db.Songs;
|
||||
}
|
||||
|
||||
[EnableQuery]
|
||||
public SingleResult<Song> Get([FromODataUri] int key) {
|
||||
logger.Log($"{nameof(SongsController)}.{nameof(Get)}({key})");
|
||||
var result = db.Songs.Where(p => p.ID == key);
|
||||
return SingleResult.Create(result);
|
||||
}
|
||||
|
||||
public async Task<IHttpActionResult> Post(Song song) {
|
||||
logger.Log($"{nameof(SongsController)}.{nameof(Post)}()");
|
||||
if (!ModelState.IsValid) return BadRequest(ModelState);
|
||||
|
||||
db.Songs.Add(song);
|
||||
await db.SaveChangesAsync();
|
||||
return Created(song);
|
||||
}
|
||||
|
||||
public async Task<IHttpActionResult> Patch([FromODataUri] int key, Delta<Song> product) {
|
||||
logger.Log($"{nameof(SongsController)}.{nameof(Patch)}({key})");
|
||||
if (!ModelState.IsValid) {
|
||||
return BadRequest(ModelState);
|
||||
}
|
||||
var entity = await db.Songs.FindAsync(key);
|
||||
if (entity == null) return NotFound();
|
||||
|
||||
product.Patch(entity);
|
||||
try {
|
||||
await db.SaveChangesAsync();
|
||||
} catch (DbUpdateConcurrencyException) {
|
||||
if (!ProductExists(key)) return NotFound();
|
||||
|
||||
throw;
|
||||
|
||||
}
|
||||
return Updated(entity);
|
||||
}
|
||||
|
||||
public async Task<IHttpActionResult> Put([FromODataUri] int key, Song update) {
|
||||
logger.Log($"{nameof(SongsController)}.{nameof(Put)}({key})");
|
||||
if (!ModelState.IsValid) return BadRequest(ModelState);
|
||||
if (key != update.ID) return BadRequest();
|
||||
|
||||
db.Entry(update).State = EntityState.Modified;
|
||||
try {
|
||||
await db.SaveChangesAsync();
|
||||
} catch (DbUpdateConcurrencyException) {
|
||||
if (!ProductExists(key)) return NotFound();
|
||||
|
||||
throw;
|
||||
|
||||
}
|
||||
return Updated(update);
|
||||
}
|
||||
|
||||
public async Task<IHttpActionResult> Delete([FromODataUri] int key) {
|
||||
logger.Log($"{nameof(SongsController)}.{nameof(Delete)}({key})");
|
||||
var product = await db.Songs.FindAsync(key);
|
||||
if (product == null) {
|
||||
return NotFound();
|
||||
}
|
||||
db.Songs.Remove(product);
|
||||
await db.SaveChangesAsync();
|
||||
return StatusCode(HttpStatusCode.NoContent);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
using API.App_Start;
|
||||
using API.Migrations;
|
||||
using API.Models;
|
||||
using System.Data.Entity;
|
||||
|
||||
namespace API.Database {
|
||||
public class DataContext : DbContext {
|
||||
|
||||
public DataContext() : base(EnvironmentConfig.Read()?.ConnectionString ?? "DataContext") {
|
||||
System.Data.Entity.Database.SetInitializer(new MigrateDatabaseToLatestVersion<DataContext, Configuration>());
|
||||
}
|
||||
|
||||
public DbSet<Song> Songs { get; set; }
|
||||
public DbSet<Change> Changes { get; set; }
|
||||
public DbSet<File> Files { get; set; }
|
||||
public DbSet<User> Users { get; set; }
|
||||
public DbSet<API.Models.Log> Logs { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
<%@ Application Codebehind="Global.asax.cs" Inherits="API.WebApiApplication" Language="C#" %>
|
||||
@@ -1,12 +0,0 @@
|
||||
using System.Web.Http;
|
||||
|
||||
namespace API
|
||||
{
|
||||
public class WebApiApplication : System.Web.HttpApplication
|
||||
{
|
||||
protected void Application_Start()
|
||||
{
|
||||
GlobalConfiguration.Configure(WebApiConfig.Register);
|
||||
}
|
||||
}
|
||||
}
|
||||
29
API/API/Migrations/201903161558469_Init.Designer.cs
generated
29
API/API/Migrations/201903161558469_Init.Designer.cs
generated
@@ -1,29 +0,0 @@
|
||||
// <auto-generated />
|
||||
namespace API.Migrations
|
||||
{
|
||||
using System.CodeDom.Compiler;
|
||||
using System.Data.Entity.Migrations;
|
||||
using System.Data.Entity.Migrations.Infrastructure;
|
||||
using System.Resources;
|
||||
|
||||
[GeneratedCode("EntityFramework.Migrations", "6.2.0-61023")]
|
||||
public sealed partial class Init : IMigrationMetadata
|
||||
{
|
||||
private readonly ResourceManager Resources = new ResourceManager(typeof(Init));
|
||||
|
||||
string IMigrationMetadata.Id
|
||||
{
|
||||
get { return "201903161558469_Init"; }
|
||||
}
|
||||
|
||||
string IMigrationMetadata.Source
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
string IMigrationMetadata.Target
|
||||
{
|
||||
get { return Resources.GetString("Target"); }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,71 +0,0 @@
|
||||
namespace API.Migrations {
|
||||
using System.Data.Entity.Migrations;
|
||||
|
||||
public partial class Init : DbMigration {
|
||||
public override void Up() {
|
||||
CreateTable(
|
||||
"dbo.Changes",
|
||||
c => new {
|
||||
ID = c.Int(nullable: false, identity: true),
|
||||
UserId = c.Int(nullable: false),
|
||||
Date = c.DateTime(nullable: false),
|
||||
Comment = c.String(),
|
||||
Song_ID = c.Int(),
|
||||
})
|
||||
.PrimaryKey(t => t.ID)
|
||||
.ForeignKey("dbo.Users", t => t.UserId, cascadeDelete: true)
|
||||
.ForeignKey("dbo.Songs", t => t.Song_ID)
|
||||
.Index(t => t.UserId)
|
||||
.Index(t => t.Song_ID);
|
||||
|
||||
CreateTable(
|
||||
"dbo.Users",
|
||||
c => new {
|
||||
ID = c.Int(nullable: false, identity: true),
|
||||
Account = c.String(),
|
||||
Pass = c.String(),
|
||||
Name = c.String(),
|
||||
Surname = c.String(),
|
||||
Email = c.String(),
|
||||
Access = c.Int(nullable: false),
|
||||
})
|
||||
.PrimaryKey(t => t.ID);
|
||||
|
||||
CreateTable(
|
||||
"dbo.Files",
|
||||
c => new {
|
||||
ID = c.Int(nullable: false, identity: true),
|
||||
ReferenceFile = c.Guid(nullable: false),
|
||||
Name = c.String(),
|
||||
FileType = c.Int(nullable: false),
|
||||
})
|
||||
.PrimaryKey(t => t.ID);
|
||||
|
||||
CreateTable(
|
||||
"dbo.Songs",
|
||||
c => new {
|
||||
ID = c.Int(nullable: false, identity: true),
|
||||
Name = c.String(),
|
||||
Text = c.String(),
|
||||
Comments = c.String(),
|
||||
Key = c.String(),
|
||||
Tempo = c.Int(),
|
||||
SongType = c.Int(nullable: false),
|
||||
Final = c.Boolean(nullable: false),
|
||||
})
|
||||
.PrimaryKey(t => t.ID);
|
||||
|
||||
}
|
||||
|
||||
public override void Down() {
|
||||
DropForeignKey("dbo.Changes", "Song_ID", "dbo.Songs");
|
||||
DropForeignKey("dbo.Changes", "UserId", "dbo.Users");
|
||||
DropIndex("dbo.Changes", new[] { "Song_ID" });
|
||||
DropIndex("dbo.Changes", new[] { "UserId" });
|
||||
DropTable("dbo.Songs");
|
||||
DropTable("dbo.Files");
|
||||
DropTable("dbo.Users");
|
||||
DropTable("dbo.Changes");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,126 +0,0 @@
|
||||
<?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>
|
||||
<data name="Target" xml:space="preserve">
|
||||
<value>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</value>
|
||||
</data>
|
||||
<data name="DefaultSchema" xml:space="preserve">
|
||||
<value>dbo</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -1,29 +0,0 @@
|
||||
// <auto-generated />
|
||||
namespace API.Migrations
|
||||
{
|
||||
using System.CodeDom.Compiler;
|
||||
using System.Data.Entity.Migrations;
|
||||
using System.Data.Entity.Migrations.Infrastructure;
|
||||
using System.Resources;
|
||||
|
||||
[GeneratedCode("EntityFramework.Migrations", "6.2.0-61023")]
|
||||
public sealed partial class SongNumber : IMigrationMetadata
|
||||
{
|
||||
private readonly ResourceManager Resources = new ResourceManager(typeof(SongNumber));
|
||||
|
||||
string IMigrationMetadata.Id
|
||||
{
|
||||
get { return "201903172015115_SongNumber"; }
|
||||
}
|
||||
|
||||
string IMigrationMetadata.Source
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
string IMigrationMetadata.Target
|
||||
{
|
||||
get { return Resources.GetString("Target"); }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
namespace API.Migrations
|
||||
{
|
||||
using System;
|
||||
using System.Data.Entity.Migrations;
|
||||
|
||||
public partial class SongNumber : DbMigration
|
||||
{
|
||||
public override void Up()
|
||||
{
|
||||
DropForeignKey("dbo.Changes", "UserId", "dbo.Users");
|
||||
DropForeignKey("dbo.Changes", "Song_ID", "dbo.Songs");
|
||||
DropIndex("dbo.Changes", new[] { "UserId" });
|
||||
DropIndex("dbo.Changes", new[] { "Song_ID" });
|
||||
DropPrimaryKey("dbo.Changes");
|
||||
DropPrimaryKey("dbo.Users");
|
||||
DropPrimaryKey("dbo.Files");
|
||||
DropPrimaryKey("dbo.Songs");
|
||||
AddColumn("dbo.Changes", "User_ID", c => c.Long());
|
||||
AddColumn("dbo.Songs", "Number", c => c.Int(nullable: false));
|
||||
AlterColumn("dbo.Changes", "ID", c => c.Long(nullable: false, identity: true));
|
||||
AlterColumn("dbo.Changes", "Song_ID", c => c.Long());
|
||||
AlterColumn("dbo.Users", "ID", c => c.Long(nullable: false, identity: true));
|
||||
AlterColumn("dbo.Files", "ID", c => c.Long(nullable: false, identity: true));
|
||||
AlterColumn("dbo.Songs", "ID", c => c.Long(nullable: false, identity: true));
|
||||
AddPrimaryKey("dbo.Changes", "ID");
|
||||
AddPrimaryKey("dbo.Users", "ID");
|
||||
AddPrimaryKey("dbo.Files", "ID");
|
||||
AddPrimaryKey("dbo.Songs", "ID");
|
||||
CreateIndex("dbo.Changes", "User_ID");
|
||||
CreateIndex("dbo.Changes", "Song_ID");
|
||||
AddForeignKey("dbo.Changes", "User_ID", "dbo.Users", "ID");
|
||||
AddForeignKey("dbo.Changes", "Song_ID", "dbo.Songs", "ID");
|
||||
}
|
||||
|
||||
public override void Down()
|
||||
{
|
||||
DropForeignKey("dbo.Changes", "Song_ID", "dbo.Songs");
|
||||
DropForeignKey("dbo.Changes", "User_ID", "dbo.Users");
|
||||
DropIndex("dbo.Changes", new[] { "Song_ID" });
|
||||
DropIndex("dbo.Changes", new[] { "User_ID" });
|
||||
DropPrimaryKey("dbo.Songs");
|
||||
DropPrimaryKey("dbo.Files");
|
||||
DropPrimaryKey("dbo.Users");
|
||||
DropPrimaryKey("dbo.Changes");
|
||||
AlterColumn("dbo.Songs", "ID", c => c.Int(nullable: false, identity: true));
|
||||
AlterColumn("dbo.Files", "ID", c => c.Int(nullable: false, identity: true));
|
||||
AlterColumn("dbo.Users", "ID", c => c.Int(nullable: false, identity: true));
|
||||
AlterColumn("dbo.Changes", "Song_ID", c => c.Int());
|
||||
AlterColumn("dbo.Changes", "ID", c => c.Int(nullable: false, identity: true));
|
||||
DropColumn("dbo.Songs", "Number");
|
||||
DropColumn("dbo.Changes", "User_ID");
|
||||
AddPrimaryKey("dbo.Songs", "ID");
|
||||
AddPrimaryKey("dbo.Files", "ID");
|
||||
AddPrimaryKey("dbo.Users", "ID");
|
||||
AddPrimaryKey("dbo.Changes", "ID");
|
||||
CreateIndex("dbo.Changes", "Song_ID");
|
||||
CreateIndex("dbo.Changes", "UserId");
|
||||
AddForeignKey("dbo.Changes", "Song_ID", "dbo.Songs", "ID");
|
||||
AddForeignKey("dbo.Changes", "UserId", "dbo.Users", "ID", cascadeDelete: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,126 +0,0 @@
|
||||
<?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>
|
||||
<data name="Target" xml:space="preserve">
|
||||
<value>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</value>
|
||||
</data>
|
||||
<data name="DefaultSchema" xml:space="preserve">
|
||||
<value>dbo</value>
|
||||
</data>
|
||||
</root>
|
||||
29
API/API/Migrations/201903172028249_Log.Designer.cs
generated
29
API/API/Migrations/201903172028249_Log.Designer.cs
generated
@@ -1,29 +0,0 @@
|
||||
// <auto-generated />
|
||||
namespace API.Migrations
|
||||
{
|
||||
using System.CodeDom.Compiler;
|
||||
using System.Data.Entity.Migrations;
|
||||
using System.Data.Entity.Migrations.Infrastructure;
|
||||
using System.Resources;
|
||||
|
||||
[GeneratedCode("EntityFramework.Migrations", "6.2.0-61023")]
|
||||
public sealed partial class Log : IMigrationMetadata
|
||||
{
|
||||
private readonly ResourceManager Resources = new ResourceManager(typeof(Log));
|
||||
|
||||
string IMigrationMetadata.Id
|
||||
{
|
||||
get { return "201903172028249_Log"; }
|
||||
}
|
||||
|
||||
string IMigrationMetadata.Source
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
string IMigrationMetadata.Target
|
||||
{
|
||||
get { return Resources.GetString("Target"); }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
namespace API.Migrations
|
||||
{
|
||||
using System;
|
||||
using System.Data.Entity.Migrations;
|
||||
|
||||
public partial class Log : DbMigration
|
||||
{
|
||||
public override void Up()
|
||||
{
|
||||
CreateTable(
|
||||
"dbo.Logs",
|
||||
c => new
|
||||
{
|
||||
ID = c.Long(nullable: false, identity: true),
|
||||
Date = c.DateTime(nullable: false),
|
||||
Method = c.String(),
|
||||
})
|
||||
.PrimaryKey(t => t.ID);
|
||||
|
||||
}
|
||||
|
||||
public override void Down()
|
||||
{
|
||||
DropTable("dbo.Logs");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,126 +0,0 @@
|
||||
<?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>
|
||||
<data name="Target" xml:space="preserve">
|
||||
<value>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</value>
|
||||
</data>
|
||||
<data name="DefaultSchema" xml:space="preserve">
|
||||
<value>dbo</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -1,9 +0,0 @@
|
||||
namespace API.Migrations {
|
||||
using System.Data.Entity.Migrations;
|
||||
|
||||
internal sealed class Configuration : DbMigrationsConfiguration<Database.DataContext> {
|
||||
public Configuration() {
|
||||
AutomaticMigrationsEnabled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
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("API")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("API")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2019")]
|
||||
[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("86bbc814-539f-4125-9eaf-7992030f3860")]
|
||||
|
||||
// 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 Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -1,21 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
|
||||
by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
-->
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<WebPublishMethod>FTP</WebPublishMethod>
|
||||
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
|
||||
<LastUsedPlatform>Any CPU</LastUsedPlatform>
|
||||
<SiteUrlToLaunchAfterPublish />
|
||||
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
|
||||
<ExcludeApp_Data>True</ExcludeApp_Data>
|
||||
<publishUrl>home472178787.1and1-data.host</publishUrl>
|
||||
<DeleteExistingFiles>False</DeleteExistingFiles>
|
||||
<FtpPassiveMode>True</FtpPassiveMode>
|
||||
<FtpSitePath>test</FtpSitePath>
|
||||
<UserName>u73527913</UserName>
|
||||
<_SavePWD>False</_SavePWD>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -1,34 +0,0 @@
|
||||
using API.Database;
|
||||
using System.Linq;
|
||||
|
||||
namespace API.Services {
|
||||
public interface IFileGarbageCollectionService {
|
||||
void Collect(string path);
|
||||
}
|
||||
public class FileGarbageCollectionService : IFileGarbageCollectionService {
|
||||
private readonly IFileService fileService;
|
||||
private readonly DataContext dataContext;
|
||||
private readonly string[] fileExcludes;
|
||||
|
||||
public FileGarbageCollectionService(
|
||||
IFileService fileService,
|
||||
DataContext dataContext
|
||||
) {
|
||||
this.fileService = fileService;
|
||||
this.dataContext = dataContext;
|
||||
fileExcludes = new[] { "environment.json" };
|
||||
}
|
||||
|
||||
public void Collect(string path) {
|
||||
var filesInStoreage = fileService.ListFiles(path);
|
||||
var filesInDatabase = dataContext.Files.Select(_ => _.ReferenceFile.ToString());
|
||||
var filesWithoutReference = filesInStoreage
|
||||
.Except(filesInDatabase)
|
||||
.Except(fileExcludes);
|
||||
|
||||
foreach (var file in filesWithoutReference) {
|
||||
fileService.Delete(path, file);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace API.Services {
|
||||
public interface IFileService {
|
||||
Task<Guid> Save(Stream file, string path, CancellationToken c);
|
||||
Stream Load(string path, string filename);
|
||||
void Delete(string path, string filename);
|
||||
IEnumerable<string> ListFiles(string path);
|
||||
}
|
||||
|
||||
public class FileService : IFileService {
|
||||
private const int bufferSize = 4096;
|
||||
|
||||
public async Task<Guid> Save(Stream inputStream, string path, CancellationToken c) {
|
||||
var filename = Guid.NewGuid();
|
||||
var fullPath = Path.Combine(path, filename.ToString());
|
||||
using (var fileStream = new FileStream(fullPath, FileMode.Create, FileAccess.Write, FileShare.None, bufferSize, true)) {
|
||||
await inputStream.CopyToAsync(fileStream, bufferSize, c);
|
||||
}
|
||||
|
||||
return filename;
|
||||
}
|
||||
|
||||
public Stream Load(string path, string filename) {
|
||||
var fullPath = Path.Combine(path, filename.ToString());
|
||||
var fileStream = new FileStream(fullPath, FileMode.Open, FileAccess.Read, FileShare.None, bufferSize, true);
|
||||
return fileStream;
|
||||
}
|
||||
|
||||
public void Delete(string path, string filename) {
|
||||
var fullPath = Path.Combine(path, filename.ToString());
|
||||
File.Delete(fullPath);
|
||||
}
|
||||
|
||||
public IEnumerable<string> ListFiles(string path) {
|
||||
var directoryInfo = new DirectoryInfo(path);
|
||||
var files = directoryInfo.GetFiles();
|
||||
var fileNames = files.Select(_ => _.Name);
|
||||
return fileNames;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
using API.Database;
|
||||
using API.Models;
|
||||
using System;
|
||||
|
||||
namespace API.Services {
|
||||
public class Logger {
|
||||
private readonly DataContext db;
|
||||
|
||||
public Logger(DataContext db) {
|
||||
this.db = db;
|
||||
}
|
||||
|
||||
public void Log(string method) {
|
||||
var log = new Log {
|
||||
Date = DateTime.Now,
|
||||
Method = method
|
||||
};
|
||||
db.Logs.Add(log);
|
||||
db.SaveChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<!-- For more information on using Web.config transformation visit https://go.microsoft.com/fwlink/?LinkId=301874 -->
|
||||
|
||||
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
|
||||
<!--
|
||||
In the example below, the "SetAttributes" transform will change the value of
|
||||
"connectionString" to use "ReleaseSQLServer" only when the "Match" locator
|
||||
finds an attribute "name" that has a value of "MyDB".
|
||||
|
||||
<connectionStrings>
|
||||
<add name="MyDB"
|
||||
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
|
||||
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
|
||||
</connectionStrings>
|
||||
-->
|
||||
<system.web>
|
||||
<!--
|
||||
In the example below, the "Replace" transform will replace the entire
|
||||
<customErrors> section of your Web.config file.
|
||||
Note that because there is only one customErrors section under the
|
||||
<system.web> node, there is no need to use the "xdt:Locator" attribute.
|
||||
|
||||
<customErrors defaultRedirect="GenericError.htm"
|
||||
mode="RemoteOnly" xdt:Transform="Replace">
|
||||
<error statusCode="500" redirect="InternalError.htm"/>
|
||||
</customErrors>
|
||||
-->
|
||||
</system.web>
|
||||
</configuration>
|
||||
@@ -1,31 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<!-- For more information on using Web.config transformation visit https://go.microsoft.com/fwlink/?LinkId=301874 -->
|
||||
|
||||
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
|
||||
<!--
|
||||
In the example below, the "SetAttributes" transform will change the value of
|
||||
"connectionString" to use "ReleaseSQLServer" only when the "Match" locator
|
||||
finds an attribute "name" that has a value of "MyDB".
|
||||
|
||||
<connectionStrings>
|
||||
<add name="MyDB"
|
||||
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
|
||||
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
|
||||
</connectionStrings>
|
||||
-->
|
||||
<system.web>
|
||||
<compilation xdt:Transform="RemoveAttributes(debug)" />
|
||||
<!--
|
||||
In the example below, the "Replace" transform will replace the entire
|
||||
<customErrors> section of your Web.config file.
|
||||
Note that because there is only one customErrors section under the
|
||||
<system.web> node, there is no need to use the "xdt:Locator" attribute.
|
||||
|
||||
<customErrors defaultRedirect="GenericError.htm"
|
||||
mode="RemoteOnly" xdt:Transform="Replace">
|
||||
<error statusCode="500" redirect="InternalError.htm"/>
|
||||
</customErrors>
|
||||
-->
|
||||
</system.web>
|
||||
</configuration>
|
||||
@@ -1,317 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
For more information on how to configure your ASP.NET application, please visit
|
||||
https://go.microsoft.com/fwlink/?LinkId=301879
|
||||
-->
|
||||
<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>
|
||||
<connectionStrings>
|
||||
<add name="DataContext" connectionString="Data Source=localhost\SQLEXPRESS;Initial Catalog=wgenerator;User ID=sa;Password=sa" providerName="System.Data.SqlClient"/>
|
||||
</connectionStrings>
|
||||
<appSettings>
|
||||
<add key="webpages:Version" value="3.0.0.0"/>
|
||||
<add key="webpages:Enabled" value="false"/>
|
||||
<add key="ClientValidationEnabled" value="true"/>
|
||||
<add key="UnobtrusiveJavaScriptEnabled" value="true"/>
|
||||
</appSettings>
|
||||
<system.web>
|
||||
<compilation debug="true" targetFramework="4.6.2"/>
|
||||
<httpRuntime targetFramework="4.6.2" maxRequestLength="30000000"/>
|
||||
</system.web>
|
||||
<system.webServer>
|
||||
<modules>
|
||||
<remove name="WebDAVModule"/>
|
||||
</modules>
|
||||
<handlers>
|
||||
<remove name="ExtensionlessUrlHandler-Integrated-4.0"/>
|
||||
<remove name="OPTIONSVerbHandler"/>
|
||||
<remove name="TRACEVerbHandler"/>
|
||||
<remove name="WebDAV"/>
|
||||
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0"/>
|
||||
</handlers>
|
||||
<security>
|
||||
<requestFiltering>
|
||||
<verbs>
|
||||
<add verb="PATCH" allowed="true" />
|
||||
</verbs>
|
||||
</requestFiltering>
|
||||
</security>
|
||||
</system.webServer>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Xml.XPath.XDocument" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Xml.XmlSerializer" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Xml.XDocument" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Xml.ReaderWriter" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.1.0" newVersion="4.1.1.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.ValueTuple" publicKeyToken="CC7B13FFCD2DDD51" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Threading.Timer" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Threading.Tasks.Parallel" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Threading.Tasks" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Threading.Overlapped" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Threading" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Text.RegularExpressions" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.1.0" newVersion="4.1.1.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Text.Encoding.Extensions" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Text.Encoding" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Security.SecureString" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Security.Principal" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Security.Cryptography.Algorithms" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.3.0.0" newVersion="4.3.0.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.Serialization.Xml" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.3.0" newVersion="4.1.3.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.Serialization.Primitives" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.Serialization.Json" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.Numerics" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.InteropServices" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Resources.ResourceManager" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Reflection.Primitives" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Reflection.Extensions" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.ObjectModel" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Net.Sockets" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Net.Requests" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Net.Primitives" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Net.NetworkInformation" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Net.Http" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Linq.Queryable" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Linq.Parallel" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Linq.Expressions" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Linq" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.IO" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.IO.Compression" publicKeyToken="B77A5C561934E089" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Globalization.Extensions" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Globalization" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Dynamic.Runtime" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Diagnostics.Tracing" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Diagnostics.Tools" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Diagnostics.StackTrace" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Diagnostics.Debug" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Diagnostics.Contracts" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Data.Common" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.ComponentModel.EventBasedAsync" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.ComponentModel" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Collections" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Collections.Concurrent" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.11.0" newVersion="4.0.11.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.InteropServices.RuntimeInformation" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Antlr3.Runtime" publicKeyToken="eb42632606e9261f"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-3.5.0.2" newVersion="3.5.0.2"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.2.1" newVersion="4.0.2.1"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Optimization" publicKeyToken="31bf3856ad364e35"/>
|
||||
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="1.1.0.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-1.6.5135.21930" newVersion="1.6.5135.21930"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-5.2.7.0" newVersion="5.2.7.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Autofac" publicKeyToken="17863af14b0044da" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.9.1.0" newVersion="4.9.1.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-5.2.7.0" newVersion="5.2.7.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Reflection" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.Extensions" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.OData.Edm" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-7.5.4.30215" newVersion="7.5.4.30215"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.OData.Core" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-7.5.4.30215" newVersion="7.5.4.30215"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.Extensions.DependencyInjection.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-2.2.0.0" newVersion="2.2.0.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.Extensions.DependencyInjection" publicKeyToken="adb9793829ddae60" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-2.2.0.0" newVersion="2.2.0.0"/>
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.Spatial" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-7.5.4.30215" newVersion="7.5.4.30215"/>
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
<entityFramework>
|
||||
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework"/>
|
||||
<providers>
|
||||
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer"/>
|
||||
</providers>
|
||||
</entityFramework>
|
||||
</configuration>
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 31 KiB |
@@ -1,33 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Antlr" version="3.5.0.2" targetFramework="net462" />
|
||||
<package id="Autofac" version="4.9.1" targetFramework="net462" />
|
||||
<package id="Autofac.WebApi2" version="4.2.0" targetFramework="net462" />
|
||||
<package id="EntityFramework" version="6.2.0" targetFramework="net462" />
|
||||
<package id="Microsoft.AspNet.Cors" version="5.2.7" targetFramework="net462" />
|
||||
<package id="Microsoft.AspNet.OData" version="7.1.0" targetFramework="net462" />
|
||||
<package id="Microsoft.AspNet.WebApi" version="5.2.7" targetFramework="net462" />
|
||||
<package id="Microsoft.AspNet.WebApi.Client" version="5.2.7" targetFramework="net462" />
|
||||
<package id="Microsoft.AspNet.WebApi.Core" version="5.2.7" targetFramework="net462" />
|
||||
<package id="Microsoft.AspNet.WebApi.Cors" version="5.2.7" targetFramework="net462" />
|
||||
<package id="Microsoft.AspNet.WebApi.WebHost" version="5.2.7" targetFramework="net462" />
|
||||
<package id="Microsoft.Extensions.DependencyInjection" version="2.2.0" targetFramework="net462" />
|
||||
<package id="Microsoft.Extensions.DependencyInjection.Abstractions" version="2.2.0" targetFramework="net462" />
|
||||
<package id="Microsoft.OData.Core" version="7.5.4" targetFramework="net462" />
|
||||
<package id="Microsoft.OData.Edm" version="7.5.4" targetFramework="net462" />
|
||||
<package id="Microsoft.Spatial" version="7.5.4" targetFramework="net462" />
|
||||
<package id="Newtonsoft.Json" version="12.0.1" targetFramework="net462" />
|
||||
<package id="System.Collections" version="4.3.0" targetFramework="net462" />
|
||||
<package id="System.Collections.Concurrent" version="4.3.0" targetFramework="net462" />
|
||||
<package id="System.ComponentModel" version="4.3.0" targetFramework="net462" />
|
||||
<package id="System.Diagnostics.Debug" version="4.3.0" targetFramework="net462" />
|
||||
<package id="System.Globalization" version="4.3.0" targetFramework="net462" />
|
||||
<package id="System.Linq" version="4.3.0" targetFramework="net462" />
|
||||
<package id="System.Linq.Expressions" version="4.3.0" targetFramework="net462" />
|
||||
<package id="System.Reflection" version="4.3.0" targetFramework="net462" />
|
||||
<package id="System.Resources.ResourceManager" version="4.3.0" targetFramework="net462" />
|
||||
<package id="System.Runtime.Extensions" version="4.3.1" targetFramework="net462" />
|
||||
<package id="System.Threading" version="4.3.0" targetFramework="net462" />
|
||||
<package id="System.Threading.Tasks" version="4.3.0" targetFramework="net462" />
|
||||
<package id="WebGrease" version="1.6.0" targetFramework="net462" />
|
||||
</packages>
|
||||
@@ -1,24 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<appSettings>
|
||||
<!--<add key="url" value="http://localhost/API" />-->
|
||||
<add key="url" value="http://test.benjamin-ifland.de"/>
|
||||
</appSettings>
|
||||
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.OData.Core" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-7.5.4.30215" newVersion="7.5.4.30215" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.OData.Edm" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-7.5.4.30215" newVersion="7.5.4.30215" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.Spatial" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-7.5.4.30215" newVersion="7.5.4.30215" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
@@ -1,95 +0,0 @@
|
||||
<?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>{48EBC2B8-5256-44BC-8A39-3A3C8C388BC6}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>Migration</RootNamespace>
|
||||
<AssemblyName>Migration</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.6.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="Microsoft.Data.Edm, Version=5.8.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Data.Edm.5.8.4\lib\net40\Microsoft.Data.Edm.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Data.OData, Version=5.8.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Data.OData.5.8.4\lib\net40\Microsoft.Data.OData.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.OData.Core, Version=7.5.4.30215, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.OData.Core.7.5.4\lib\portable-net45+win8+wpa81\Microsoft.OData.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.OData.Edm, Version=7.5.4.30215, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.OData.Edm.7.5.4\lib\portable-net45+win8+wpa81\Microsoft.OData.Edm.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Spatial, Version=7.5.4.30215, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Spatial.7.5.4\lib\portable-net45+win8+wpa81\Microsoft.Spatial.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Simple.OData.Client.Core, Version=5.6.2.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Simple.OData.Client.5.6.2\lib\net452\Simple.OData.Client.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Simple.OData.Client.Dynamic, Version=5.6.2.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Simple.OData.Client.5.6.2\lib\net452\Simple.OData.Client.Dynamic.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Simple.OData.Client.V3.Adapter, Version=5.6.2.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Simple.OData.Client.5.6.2\lib\net452\Simple.OData.Client.V3.Adapter.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Simple.OData.Client.V4.Adapter, Version=5.6.2.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Simple.OData.Client.5.6.2\lib\net452\Simple.OData.Client.V4.Adapter.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Spatial, Version=5.8.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Spatial.5.8.4\lib\net40\System.Spatial.dll</HintPath>
|
||||
</Reference>
|
||||
<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="SongDataset.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\API.Client\API.Client.csproj">
|
||||
<Project>{88db6691-8ee1-428c-8da4-50342aeb2c54}</Project>
|
||||
<Name>API.Client</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Models\API.Models.csproj">
|
||||
<Project>{8d72ff7d-c085-4c06-9d66-9537b7ac924d}</Project>
|
||||
<Name>API.Models</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
@@ -1,67 +0,0 @@
|
||||
using API.Client;
|
||||
using API.Models;
|
||||
using Data;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Migration {
|
||||
internal class Program {
|
||||
private static void Main(string[] args) {
|
||||
var path = @"d:\Documents\Worship Generator\";
|
||||
|
||||
for (var i = 0; i < 500; i++) {
|
||||
var xmlFile = Path.Combine(path, i.ToString() + ".xml");
|
||||
if (!System.IO.File.Exists(xmlFile)) continue;
|
||||
|
||||
var ds = new SongDataset();
|
||||
ds.ReadXml(xmlFile);
|
||||
|
||||
var source = ds.SONGLIST[0];
|
||||
|
||||
var song = new Song {
|
||||
Name = source.NAME.TrimEnd('\r', '\n'),
|
||||
Number = source.NUMBER,
|
||||
SongType = MapSongType(source),
|
||||
Tempo = source.IsSPEEDNull() ? (int?)null : source.SPEED,
|
||||
Key = MapKey(source),
|
||||
Text = source.IsPREVIEWNull() ? null : source.PREVIEW,
|
||||
Comments = source.IsCOMMENTNull() ? null : source.COMMENT,
|
||||
Final = source.IsFINALNull() ? false : source.FINAL
|
||||
};
|
||||
Console.WriteLine(song.Name);
|
||||
|
||||
var client = new Client();
|
||||
Task.WaitAll(new[] { client.Post(song) });
|
||||
}
|
||||
|
||||
Console.ReadKey();
|
||||
|
||||
}
|
||||
private static SongType MapSongType(SongDataset.SONGLISTRow source) {
|
||||
if (source.IsKINDNull()) return SongType.None;
|
||||
switch (source.KIND) {
|
||||
case "Lobpreis": return SongType.Praise;
|
||||
case "Anbetung": return SongType.Worship;
|
||||
default: return SongType.None;
|
||||
}
|
||||
}
|
||||
|
||||
private static string MapKey(SongDataset.SONGLISTRow source) {
|
||||
if (source.IsHARMONICNull()) return null;
|
||||
|
||||
switch (source.HARMONIC) {
|
||||
case "D": return KeysSMaj.D;
|
||||
case "a": return KeysSMin.A;
|
||||
case "d": return KeysSMin.D;
|
||||
case "G": return KeysSMaj.G;
|
||||
case "E": return KeysSMaj.E;
|
||||
case "C": return KeysSMaj.C;
|
||||
case "A": return KeysSMaj.A;
|
||||
case "e": return KeysSMin.E;
|
||||
case "fis": return KeysSMin.FS;
|
||||
default: return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
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("Migration")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Migration")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2019")]
|
||||
[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("48ebc2b8-5256-44bc-8a39-3a3c8c388bc6")]
|
||||
|
||||
// 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")]
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Microsoft.Data.Edm" version="5.8.4" targetFramework="net462" />
|
||||
<package id="Microsoft.Data.OData" version="5.8.4" targetFramework="net462" />
|
||||
<package id="Microsoft.OData.Core" version="7.5.4" targetFramework="net462" />
|
||||
<package id="Microsoft.OData.Edm" version="7.5.4" targetFramework="net462" />
|
||||
<package id="Microsoft.Spatial" version="7.5.4" targetFramework="net462" />
|
||||
<package id="Simple.OData.Client" version="5.6.2" targetFramework="net462" />
|
||||
<package id="System.Spatial" version="5.8.4" targetFramework="net462" />
|
||||
</packages>
|
||||
@@ -1,66 +0,0 @@
|
||||
<?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>{8D72FF7D-C085-4C06-9D66-9537B7AC924D}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Models</RootNamespace>
|
||||
<AssemblyName>Models</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<Deterministic>true</Deterministic>
|
||||
</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.2.0\lib\net45\EntityFramework.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<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.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Access.cs" />
|
||||
<Compile Include="Change.cs" />
|
||||
<Compile Include="File.cs" />
|
||||
<Compile Include="FileType.cs" />
|
||||
<Compile Include="Log.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Song.cs" />
|
||||
<Compile Include="SongType.cs" />
|
||||
<Compile Include="User.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
@@ -1,8 +0,0 @@
|
||||
namespace API.Models {
|
||||
public enum Access {
|
||||
Inactive,
|
||||
Reader,
|
||||
Writer,
|
||||
Admin
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
<?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.SqlConnectionFactory, EntityFramework" />
|
||||
<providers>
|
||||
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
|
||||
</providers>
|
||||
</entityFramework>
|
||||
</configuration>
|
||||
@@ -1,11 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace API.Models {
|
||||
public class Change {
|
||||
public long ID { get; set; }
|
||||
public int UserId { get; set; }
|
||||
public User User { get; set; }
|
||||
public DateTime Date { get; set; }
|
||||
public string Comment { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace API.Models {
|
||||
public class File {
|
||||
public long ID { get; set; }
|
||||
[Index(IsUnique = true)]
|
||||
public Guid ReferenceFile { get; set; }
|
||||
public string Name { get; set; }
|
||||
public FileType FileType { get; set; }
|
||||
|
||||
public virtual Song Song { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
namespace API.Models {
|
||||
public enum FileType {
|
||||
None,
|
||||
Sheet,
|
||||
Chords,
|
||||
MuseScore
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace API.Models {
|
||||
public class Log {
|
||||
public long ID { get; set; }
|
||||
public DateTime Date { get; set; }
|
||||
public string Method { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
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("Models")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Models")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2019")]
|
||||
[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("8d72ff7d-c085-4c06-9d66-9537b7ac924d")]
|
||||
|
||||
// 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")]
|
||||
@@ -1,84 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace API.Models {
|
||||
public class Song {
|
||||
public long ID { get; set; }
|
||||
[Index(IsUnique = true)]
|
||||
public int Number { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Text { get; set; }
|
||||
public string Comments { get; set; }
|
||||
public string Key { get; set; }
|
||||
public int? Tempo { get; set; }
|
||||
public SongType SongType { get; set; }
|
||||
|
||||
public bool Final { get; set; }
|
||||
|
||||
public virtual ICollection<Change> Changes { get; set; }
|
||||
|
||||
public virtual ICollection<File> Files { get; set; }
|
||||
}
|
||||
|
||||
public class KeysSMaj {
|
||||
public const string C = "C";
|
||||
public const string CS = "C#";
|
||||
public const string D = "D";
|
||||
public const string DS = "D#";
|
||||
public const string E = "E";
|
||||
public const string F = "F";
|
||||
public const string FS = "F#";
|
||||
public const string G = "G";
|
||||
public const string GS = "G#";
|
||||
public const string A = "A";
|
||||
public const string AS = "A#";
|
||||
public const string H = "H";
|
||||
}
|
||||
|
||||
public class KeysSMin {
|
||||
public const string C = "c";
|
||||
public const string CS = "c#";
|
||||
public const string D = "d";
|
||||
public const string DS = "d#";
|
||||
public const string E = "e";
|
||||
public const string F = "f";
|
||||
public const string FS = "f#";
|
||||
public const string G = "g";
|
||||
public const string GS = "g#";
|
||||
public const string A = "a";
|
||||
public const string AS = "a#";
|
||||
public const string H = "h";
|
||||
}
|
||||
|
||||
public class KeysBMaj {
|
||||
public const string C = "C";
|
||||
public const string DB = "Db";
|
||||
public const string D = "D";
|
||||
public const string EB = "Eb";
|
||||
public const string E = "E";
|
||||
public const string F = "F";
|
||||
public const string GB = "Gb";
|
||||
public const string G = "G";
|
||||
public const string AB = "Ab";
|
||||
public const string A = "A";
|
||||
public const string HB = "B";
|
||||
public const string H = "H";
|
||||
}
|
||||
|
||||
public class KeysBMin {
|
||||
public const string C = "a";
|
||||
public const string DB = "db";
|
||||
public const string D = "d";
|
||||
public const string EB = "eb";
|
||||
public const string E = "e";
|
||||
public const string F = "f";
|
||||
public const string GB = "gb";
|
||||
public const string G = "g";
|
||||
public const string AB = "ab";
|
||||
public const string A = "a";
|
||||
public const string HB = "b";
|
||||
public const string H = "h";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
namespace API.Models {
|
||||
public enum SongType {
|
||||
Praise,
|
||||
Worship,
|
||||
None
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace API.Models {
|
||||
public class User {
|
||||
public long ID { get; set; }
|
||||
[Index(IsUnique = true)]
|
||||
public string Account { get; set; }
|
||||
public string Pass { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Surname { get; set; }
|
||||
[Index(IsUnique = true)]
|
||||
public string Email { get; set; }
|
||||
public Access Access { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="EntityFramework" version="6.2.0" targetFramework="net462" />
|
||||
</packages>
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"projects": {
|
||||
"default": "worshipgenerator"
|
||||
}
|
||||
}
|
||||
65
WEB/.gitignore
vendored
65
WEB/.gitignore
vendored
@@ -1,65 +0,0 @@
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
firebase-debug.log*
|
||||
|
||||
# Firebase cache
|
||||
.firebase/
|
||||
|
||||
# Firebase config
|
||||
|
||||
# Uncomment this if you'd like others to create their own Firebase project.
|
||||
# For a team working on the same Firebase project(s), it is recommended to leave
|
||||
# it commented so all members can deploy to the same project(s) in .firebaserc.
|
||||
# .firebaserc
|
||||
|
||||
# Runtime data
|
||||
pids
|
||||
*.pid
|
||||
*.seed
|
||||
*.pid.lock
|
||||
|
||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||
lib-cov
|
||||
|
||||
# Coverage directory used by tools like istanbul
|
||||
coverage
|
||||
|
||||
# nyc test coverage
|
||||
.nyc_output
|
||||
|
||||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
|
||||
.grunt
|
||||
|
||||
# Bower dependency directory (https://bower.io/)
|
||||
bower_components
|
||||
|
||||
# node-waf configuration
|
||||
.lock-wscript
|
||||
|
||||
# Compiled binary addons (http://nodejs.org/api/addons.html)
|
||||
build/Release
|
||||
|
||||
# Dependency directories
|
||||
node_modules/
|
||||
|
||||
# Optional npm cache directory
|
||||
.npm
|
||||
|
||||
# Optional eslint cache
|
||||
.eslintcache
|
||||
|
||||
# Optional REPL history
|
||||
.node_repl_history
|
||||
|
||||
# Output of 'npm pack'
|
||||
*.tgz
|
||||
|
||||
# Yarn Integrity file
|
||||
.yarn-integrity
|
||||
|
||||
# dotenv environment variables file
|
||||
.env
|
||||
15
WEB/.vscode/launch.json
vendored
15
WEB/.vscode/launch.json
vendored
@@ -1,15 +0,0 @@
|
||||
{
|
||||
// Use IntelliSense to learn about possible attributes.
|
||||
// Hover to view descriptions of existing attributes.
|
||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"type": "chrome",
|
||||
"request": "launch",
|
||||
"name": "Launch Chrome against localhost",
|
||||
"url": "http://localhost:4200",
|
||||
"webRoot": "${workspaceFolder}"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
# Wgenerator
|
||||
|
||||
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 7.0.3.
|
||||
|
||||
## Development server
|
||||
|
||||
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
|
||||
|
||||
## Code scaffolding
|
||||
|
||||
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
|
||||
|
||||
## Build
|
||||
|
||||
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.
|
||||
|
||||
## Running unit tests
|
||||
|
||||
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
|
||||
|
||||
## Running end-to-end tests
|
||||
|
||||
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
|
||||
|
||||
## Further help
|
||||
|
||||
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
|
||||
139
WEB/angular.json
139
WEB/angular.json
@@ -1,139 +0,0 @@
|
||||
{
|
||||
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
||||
"version": 1,
|
||||
"newProjectRoot": "projects",
|
||||
"projects": {
|
||||
"wgenerator": {
|
||||
"root": "",
|
||||
"sourceRoot": "src",
|
||||
"projectType": "application",
|
||||
"prefix": "app",
|
||||
"schematics": {
|
||||
"@schematics/angular:component": {
|
||||
"styleext": "less"
|
||||
}
|
||||
},
|
||||
"architect": {
|
||||
"build": {
|
||||
"builder": "@angular-devkit/build-angular:browser",
|
||||
"options": {
|
||||
"outputPath": "dist/wgenerator",
|
||||
"index": "src/index.html",
|
||||
"main": "src/main.ts",
|
||||
"polyfills": "src/polyfills.ts",
|
||||
"tsConfig": "src/tsconfig.app.json",
|
||||
"assets": [
|
||||
"src/favicon.ico",
|
||||
"src/assets"
|
||||
],
|
||||
"styles": [
|
||||
"src/styles.less"
|
||||
],
|
||||
"scripts": []
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"fileReplacements": [
|
||||
{
|
||||
"replace": "src/environments/environment.ts",
|
||||
"with": "src/environments/environment.prod.ts"
|
||||
}
|
||||
],
|
||||
"optimization": true,
|
||||
"outputHashing": "all",
|
||||
"sourceMap": false,
|
||||
"extractCss": true,
|
||||
"namedChunks": false,
|
||||
"aot": true,
|
||||
"extractLicenses": true,
|
||||
"vendorChunk": false,
|
||||
"buildOptimizer": true,
|
||||
"budgets": [
|
||||
{
|
||||
"type": "initial",
|
||||
"maximumWarning": "2mb",
|
||||
"maximumError": "5mb"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"serve": {
|
||||
"builder": "@angular-devkit/build-angular:dev-server",
|
||||
"options": {
|
||||
"browserTarget": "wgenerator:build"
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"browserTarget": "wgenerator:build:production"
|
||||
}
|
||||
}
|
||||
},
|
||||
"extract-i18n": {
|
||||
"builder": "@angular-devkit/build-angular:extract-i18n",
|
||||
"options": {
|
||||
"browserTarget": "wgenerator:build"
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"builder": "@angular-devkit/build-angular:karma",
|
||||
"options": {
|
||||
"main": "src/test.ts",
|
||||
"polyfills": "src/polyfills.ts",
|
||||
"tsConfig": "src/tsconfig.spec.json",
|
||||
"karmaConfig": "src/karma.conf.js",
|
||||
"styles": [
|
||||
"src/styles.less"
|
||||
],
|
||||
"scripts": [],
|
||||
"assets": [
|
||||
"src/favicon.ico",
|
||||
"src/assets"
|
||||
]
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"builder": "@angular-devkit/build-angular:tslint",
|
||||
"options": {
|
||||
"tsConfig": [
|
||||
"src/tsconfig.app.json",
|
||||
"src/tsconfig.spec.json"
|
||||
],
|
||||
"exclude": [
|
||||
"**/node_modules/**"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"wgenerator-e2e": {
|
||||
"root": "e2e/",
|
||||
"projectType": "application",
|
||||
"prefix": "",
|
||||
"architect": {
|
||||
"e2e": {
|
||||
"builder": "@angular-devkit/build-angular:protractor",
|
||||
"options": {
|
||||
"protractorConfig": "e2e/protractor.conf.js",
|
||||
"devServerTarget": "wgenerator:serve"
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"devServerTarget": "wgenerator:serve:production"
|
||||
}
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"builder": "@angular-devkit/build-angular:tslint",
|
||||
"options": {
|
||||
"tsConfig": "e2e/tsconfig.e2e.json",
|
||||
"exclude": [
|
||||
"**/node_modules/**"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"defaultProject": "wgenerator"
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
// Protractor configuration file, see link for more information
|
||||
// https://github.com/angular/protractor/blob/master/lib/config.ts
|
||||
|
||||
const { SpecReporter } = require('jasmine-spec-reporter');
|
||||
|
||||
exports.config = {
|
||||
allScriptsTimeout: 11000,
|
||||
specs: [
|
||||
'./src/**/*.e2e-spec.ts'
|
||||
],
|
||||
capabilities: {
|
||||
'browserName': 'chrome'
|
||||
},
|
||||
directConnect: true,
|
||||
baseUrl: 'http://localhost:4200/',
|
||||
framework: 'jasmine',
|
||||
jasmineNodeOpts: {
|
||||
showColors: true,
|
||||
defaultTimeoutInterval: 30000,
|
||||
print: function() {}
|
||||
},
|
||||
onPrepare() {
|
||||
require('ts-node').register({
|
||||
project: require('path').join(__dirname, './tsconfig.e2e.json')
|
||||
});
|
||||
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
|
||||
}
|
||||
};
|
||||
@@ -1,14 +0,0 @@
|
||||
import { AppPage } from './app.po';
|
||||
|
||||
describe('workspace-project App', () => {
|
||||
let page: AppPage;
|
||||
|
||||
beforeEach(() => {
|
||||
page = new AppPage();
|
||||
});
|
||||
|
||||
it('should display welcome message', () => {
|
||||
page.navigateTo();
|
||||
expect(page.getParagraphText()).toEqual('Welcome to wgenerator!');
|
||||
});
|
||||
});
|
||||
@@ -1,11 +0,0 @@
|
||||
import { browser, by, element } from 'protractor';
|
||||
|
||||
export class AppPage {
|
||||
navigateTo() {
|
||||
return browser.get('/');
|
||||
}
|
||||
|
||||
getParagraphText() {
|
||||
return element(by.css('app-root h1')).getText();
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
{
|
||||
"extends": "../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../out-tsc/app",
|
||||
"module": "commonjs",
|
||||
"target": "es5",
|
||||
"types": [
|
||||
"jasmine",
|
||||
"jasminewd2",
|
||||
"node"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
{
|
||||
"hosting": {
|
||||
"public": "dist/wgenerator",
|
||||
"rewrites": [
|
||||
{
|
||||
"source": "**",
|
||||
"destination": "/index.html"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
11110
WEB/package-lock.json
generated
11110
WEB/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,59 +0,0 @@
|
||||
{
|
||||
"name": "wgenerator",
|
||||
"version": "0.0.0",
|
||||
"scripts": {
|
||||
"ng": "ng",
|
||||
"deploy": "ng build --prod && firebase deploy",
|
||||
"start": "ng serve",
|
||||
"build": "ng build",
|
||||
"test": "ng test",
|
||||
"lint": "ng lint",
|
||||
"e2e": "ng e2e"
|
||||
},
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@angular/animations": "~8.2.0",
|
||||
"@angular/cdk": "^8.1.2",
|
||||
"@angular/common": "~8.2.0",
|
||||
"@angular/compiler": "~8.2.0",
|
||||
"@angular/core": "~8.2.0",
|
||||
"@angular/fire": "^5.2.1",
|
||||
"@angular/forms": "~8.2.0",
|
||||
"@angular/http": "~7.2.15",
|
||||
"@angular/material": "^8.1.2",
|
||||
"@angular/platform-browser": "~8.2.0",
|
||||
"@angular/platform-browser-dynamic": "~8.2.0",
|
||||
"@angular/router": "~8.2.0",
|
||||
"@fortawesome/angular-fontawesome": "^0.4.0",
|
||||
"@fortawesome/fontawesome-svg-core": "^1.2.21",
|
||||
"@fortawesome/free-solid-svg-icons": "^5.10.1",
|
||||
"angular2-uuid": "^1.1.1",
|
||||
"core-js": "^3.1.4",
|
||||
"firebase": "^6.3.4",
|
||||
"ng2-file-upload": "^1.3.0",
|
||||
"odata-v4-ng": "^1.2.1",
|
||||
"rxjs": "^6.5.2",
|
||||
"zone.js": "~0.10.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular-devkit/build-angular": "^0.802.0",
|
||||
"@angular/cli": "~8.2.0",
|
||||
"@angular/compiler-cli": "^8.2.0",
|
||||
"@angular/language-service": "~8.2.0",
|
||||
"@types/jasmine": "~3.3.16",
|
||||
"@types/jasminewd2": "~2.0.6",
|
||||
"@types/node": "~12.6.9",
|
||||
"codelyzer": "~5.1.0",
|
||||
"jasmine-core": "~3.4.0",
|
||||
"jasmine-spec-reporter": "~4.2.1",
|
||||
"karma": "~4.2.0",
|
||||
"karma-chrome-launcher": "~3.0.0",
|
||||
"karma-coverage-istanbul-reporter": "~2.1.0",
|
||||
"karma-jasmine": "~2.0.1",
|
||||
"karma-jasmine-html-reporter": "^1.4.2",
|
||||
"protractor": "~5.4.2",
|
||||
"ts-node": "~8.3.0",
|
||||
"tslint": "~5.18.0",
|
||||
"typescript": "^3.5.3"
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
import {NgModule} from '@angular/core';
|
||||
import {RouterModule, Routes} from '@angular/router';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: 'login',
|
||||
loadChildren: () => import('./modules/login/login.module').then(_ => _.LoginModule)
|
||||
}
|
||||
]
|
||||
;
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule]
|
||||
})
|
||||
export class AccountRoutingModule {
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
import {NgModule} from '@angular/core';
|
||||
import {CommonModule} from '@angular/common';
|
||||
|
||||
import {AccountRoutingModule} from './account-routing.module';
|
||||
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
AccountRoutingModule,
|
||||
]
|
||||
})
|
||||
export class AccountModule {
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
<mat-card>
|
||||
<mat-card-header>
|
||||
<mat-card-title>Login</mat-card-title>
|
||||
<mat-card-subtitle></mat-card-subtitle>
|
||||
</mat-card-header>
|
||||
<mat-card-content>
|
||||
<form>
|
||||
<mat-form-field>
|
||||
<input [formControl]="user" matInput placeholder="Benutzername">
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field>
|
||||
<input [formControl]="pass" matInput placeholder="Passwort" type="password">
|
||||
</mat-form-field>
|
||||
</form>
|
||||
</mat-card-content>
|
||||
<mat-card-actions>
|
||||
<button (click)="onLogin()" mat-button>Login</button>
|
||||
<button mat-button>Abbrechen</button>
|
||||
</mat-card-actions>
|
||||
</mat-card>
|
||||
@@ -1,5 +0,0 @@
|
||||
form {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 20px 0;
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
import {async, ComponentFixture, TestBed} from '@angular/core/testing';
|
||||
|
||||
import {LoginComponent} from './login.component';
|
||||
|
||||
describe('LoginComponent', () => {
|
||||
let component: LoginComponent;
|
||||
let fixture: ComponentFixture<LoginComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [LoginComponent]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(LoginComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -1,41 +0,0 @@
|
||||
import {Component, OnInit} from '@angular/core';
|
||||
import {AuthService} from '../../../../../services/auth.service';
|
||||
import {FormControl} from '@angular/forms';
|
||||
import {ActivatedRoute, Router} from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'app-login',
|
||||
templateUrl: './login.component.html',
|
||||
styleUrls: ['./login.component.less']
|
||||
})
|
||||
export class LoginComponent implements OnInit {
|
||||
public user = new FormControl();
|
||||
public pass = new FormControl();
|
||||
public loginError = false;
|
||||
|
||||
private redirect: string = null;
|
||||
|
||||
constructor(
|
||||
private authService: AuthService,
|
||||
private router: Router,
|
||||
activatedRoute: ActivatedRoute
|
||||
) {
|
||||
activatedRoute.queryParams.subscribe(_ => this.redirect = _.redirect);
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.loginError = false;
|
||||
}
|
||||
|
||||
public onLogin(): void {
|
||||
this.authService.login$(this.user.value, this.pass.value).subscribe(_ => {
|
||||
if (_ === null) {
|
||||
this.loginError = true;
|
||||
} else {
|
||||
if (this.redirect) {
|
||||
this.router.navigateByUrl('/' + this.redirect);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
import {NgModule} from '@angular/core';
|
||||
import {RouterModule, Routes} from '@angular/router';
|
||||
import {LoginComponent} from './components/login/login.component';
|
||||
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: LoginComponent,
|
||||
pathMatch: 'full'
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule]
|
||||
})
|
||||
export class LoginRoutingModule {
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
import {NgModule} from '@angular/core';
|
||||
import {CommonModule} from '@angular/common';
|
||||
|
||||
import {LoginRoutingModule} from './login-routing.module';
|
||||
import {LoginComponent} from './components/login/login.component';
|
||||
import {MatButtonModule, MatCardModule, MatInputModule} from '@angular/material';
|
||||
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
|
||||
|
||||
|
||||
@NgModule({
|
||||
declarations: [LoginComponent],
|
||||
imports: [
|
||||
CommonModule,
|
||||
LoginRoutingModule,
|
||||
FormsModule,
|
||||
ReactiveFormsModule,
|
||||
|
||||
MatCardModule,
|
||||
MatInputModule,
|
||||
MatButtonModule
|
||||
]
|
||||
})
|
||||
export class LoginModule {
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
import {NgModule} from '@angular/core';
|
||||
import {RouterModule, Routes} from '@angular/router';
|
||||
import {AuthGuard} from './guards/auth.guard';
|
||||
|
||||
const routes: Routes = [
|
||||
|
||||
{
|
||||
path: '',
|
||||
pathMatch: 'full',
|
||||
redirectTo: 'songs'
|
||||
},
|
||||
{
|
||||
path: 'songs',
|
||||
loadChildren: () => import('./songs/songs.module').then(_ => _.SongsModule),
|
||||
canActivate: [AuthGuard],
|
||||
},
|
||||
{
|
||||
path: 'account',
|
||||
loadChildren: () => import('./account/account.module').then(_ => _.AccountModule)
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forRoot(routes, {onSameUrlNavigation: 'reload'})],
|
||||
exports: [RouterModule]
|
||||
})
|
||||
export class AppRoutingModule {
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
<router-outlet></router-outlet>
|
||||
@@ -1,4 +0,0 @@
|
||||
:root {
|
||||
display: block;
|
||||
padding: 10px;
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
import {Component} from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-root',
|
||||
templateUrl: './app.component.html',
|
||||
styleUrls: ['./app.component.less']
|
||||
})
|
||||
export class AppComponent {
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
import {BrowserModule} from '@angular/platform-browser';
|
||||
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
|
||||
import {NgModule} from '@angular/core';
|
||||
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
|
||||
import {ODataModule} from 'odata-v4-ng';
|
||||
|
||||
import {AppRoutingModule} from './app-routing.module';
|
||||
import {AppComponent} from './app.component';
|
||||
import {HttpClientModule} from '@angular/common/http';
|
||||
import {FontAwesomeModule} from '@fortawesome/angular-fontawesome';
|
||||
|
||||
import {MatInputModule} from '@angular/material/input';
|
||||
import {MatTableModule} from '@angular/material/table';
|
||||
import {MatCardModule} from '@angular/material/card';
|
||||
import {MatButtonModule} from '@angular/material/button';
|
||||
import {MatChipsModule} from '@angular/material/chips';
|
||||
import {MatRadioModule} from '@angular/material/radio';
|
||||
import {MatSelectModule} from '@angular/material/select';
|
||||
import {MatTooltipModule} from '@angular/material/tooltip';
|
||||
import {MatProgressBarModule} from '@angular/material/progress-bar';
|
||||
import {FileUploadModule} from 'ng2-file-upload';
|
||||
import {AngularFireModule} from '@angular/fire';
|
||||
import {AngularFireAuthModule} from '@angular/fire/auth';
|
||||
import {AngularFirestoreModule} from '@angular/fire/firestore';
|
||||
import {environment} from '../environments/environment';
|
||||
import {AngularFireDatabaseModule} from '@angular/fire/database';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
AppComponent
|
||||
],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
BrowserAnimationsModule,
|
||||
FormsModule,
|
||||
ReactiveFormsModule,
|
||||
HttpClientModule,
|
||||
ODataModule,
|
||||
|
||||
MatInputModule,
|
||||
MatCardModule,
|
||||
MatTableModule,
|
||||
MatButtonModule,
|
||||
MatChipsModule,
|
||||
MatRadioModule,
|
||||
MatSelectModule,
|
||||
MatTooltipModule,
|
||||
MatProgressBarModule,
|
||||
|
||||
FontAwesomeModule,
|
||||
FileUploadModule,
|
||||
AppRoutingModule,
|
||||
|
||||
AngularFireModule.initializeApp(environment.firebase),
|
||||
AngularFirestoreModule, // imports firebase/firestore, only needed for database features
|
||||
AngularFireAuthModule, // imports firebase/auth, only needed for auth features
|
||||
AngularFireDatabaseModule,
|
||||
],
|
||||
providers: [],
|
||||
bootstrap: [AppComponent]
|
||||
})
|
||||
export class AppModule {
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
import {Expand, ODataQuery, ODataService} from 'odata-v4-ng';
|
||||
import {Observable} from 'rxjs';
|
||||
import {map, tap} from 'rxjs/operators';
|
||||
import {environment} from '../../environments/environment';
|
||||
|
||||
export class ODataBaseService {
|
||||
private readonly url: string;
|
||||
|
||||
constructor(private odataService: ODataService, private entity: string) {
|
||||
this.url = `${environment.api}/odata/`;
|
||||
}
|
||||
|
||||
public list$<TResponse>(properties: string[], skip: number = null, top: number = null): Observable<{ count: number, data: TResponse[] }> {
|
||||
const query = new ODataQuery(this.odataService, this.url)
|
||||
.entitySet(this.entity)
|
||||
.countOption(true)
|
||||
.skip(skip)
|
||||
.top(top)
|
||||
.select(properties);
|
||||
|
||||
const get = query.get().pipe(map(_ => ({
|
||||
count: _.getBodyAsJson()['@odata.count'],
|
||||
data: _.toPropertyValue<TResponse[]>()
|
||||
})));
|
||||
|
||||
return get;
|
||||
}
|
||||
|
||||
public get$<TResponse>(
|
||||
id: number,
|
||||
select: string[],
|
||||
expands: string[]
|
||||
): Observable<TResponse> {
|
||||
const query = new ODataQuery(this.odataService, this.url)
|
||||
.entitySet(this.entity)
|
||||
.entityKey(id)
|
||||
.expand(expands.map(_ => new Expand(_)))
|
||||
.select(select);
|
||||
const get = query.get().pipe(map(_ => _.toEntity<TResponse>()));
|
||||
|
||||
return get;
|
||||
}
|
||||
|
||||
public patch$(id: number, control: string, value: any): Observable<boolean> {
|
||||
const valueSet = {[control]: value};
|
||||
const query = new ODataQuery(this.odataService, this.url)
|
||||
.entitySet(this.entity)
|
||||
.entityKey(id);
|
||||
const get = query.patch(valueSet).pipe(map(() => true));
|
||||
|
||||
return get;
|
||||
}
|
||||
|
||||
public post$<TResponse>(values: any): Observable<TResponse> {
|
||||
const querry = new ODataQuery(this.odataService, this.url);
|
||||
const post = querry
|
||||
.entitySet(this.entity)
|
||||
.post(values)
|
||||
.pipe(
|
||||
tap(_ => console.log(_)),
|
||||
map(_ => {
|
||||
const mapped = _.toEntity<TResponse>();
|
||||
return mapped;
|
||||
}),
|
||||
tap(_ => console.log(_))
|
||||
);
|
||||
|
||||
return post;
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
import {HttpClient} from '@angular/common/http';
|
||||
import {Injectable} from '@angular/core';
|
||||
import {environment} from '../../environments/environment';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class DownloadService {
|
||||
constructor(private httpClient: HttpClient) {
|
||||
}
|
||||
|
||||
public get(songId: number, fileId: number, filename: string) {
|
||||
return this.httpClient
|
||||
.get(`${environment.api}/api/songs/${songId}/files/${fileId}`, {
|
||||
responseType: 'blob' as 'json',
|
||||
observe: 'response'
|
||||
})
|
||||
.subscribe(
|
||||
(response: any) => {
|
||||
const contentType = response.headers.get('Content-Type');
|
||||
const downloadLink = document.createElement('a');
|
||||
const blob = new Blob([response.body], {type: contentType});
|
||||
downloadLink.href = window.URL.createObjectURL(blob);
|
||||
downloadLink.setAttribute('download', filename);
|
||||
document.body.appendChild(downloadLink);
|
||||
downloadLink.click();
|
||||
},
|
||||
error => {
|
||||
console.log('download error:', JSON.stringify(error));
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,103 +0,0 @@
|
||||
import {SongsService} from 'src/app/data/songs.service';
|
||||
import {Injectable} from '@angular/core';
|
||||
import {FormControl, FormGroup, Validators} from '@angular/forms';
|
||||
import {switchMap} from 'rxjs/operators';
|
||||
import {Song} from '../songs/models/song.model';
|
||||
import {Subscription} from 'rxjs';
|
||||
import {File} from '../songs/models/file.model';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class EditSongService {
|
||||
|
||||
constructor(private songsService: SongsService) {
|
||||
}
|
||||
|
||||
public initSongEditForm(attachSync: boolean, _song: Song): FormGroup {
|
||||
const song = attachSync
|
||||
? _song
|
||||
: this.defaultValues();
|
||||
const form = new FormGroup({
|
||||
Number: new FormControl(song.Number, {
|
||||
updateOn: 'blur',
|
||||
validators: [Validators.required, Validators.min(1)]
|
||||
}),
|
||||
Name: new FormControl(song.Name, {
|
||||
updateOn: 'blur',
|
||||
validators: Validators.required
|
||||
}),
|
||||
Text: new FormControl(song.Text, {updateOn: 'blur'}),
|
||||
SongType: new FormControl(song.SongType, {
|
||||
updateOn: 'blur',
|
||||
validators: Validators.required
|
||||
}),
|
||||
Key: new FormControl(song.Key, {
|
||||
updateOn: 'blur',
|
||||
validators: Validators.required
|
||||
}),
|
||||
Tempo: new FormControl(song.Tempo, {updateOn: 'blur'}),
|
||||
Comments: new FormControl(song.Comments, {updateOn: 'blur'})
|
||||
});
|
||||
|
||||
if (attachSync) {
|
||||
this.attachSync(form, song);
|
||||
}
|
||||
|
||||
return form;
|
||||
}
|
||||
|
||||
public initFileEditForm(songId: number, file: File): { form: FormGroup, changeSubscription: Subscription } {
|
||||
const form = new FormGroup({
|
||||
Name: new FormControl(file.Name, {
|
||||
updateOn: 'blur',
|
||||
validators: Validators.required
|
||||
}),
|
||||
FileType: new FormControl(file.FileType, {
|
||||
updateOn: 'blur'
|
||||
})
|
||||
});
|
||||
|
||||
const changeSubscription = form.valueChanges.pipe(
|
||||
switchMap(_ => this.songsService.updateFile$(songId, file.ID, _.Name, _.FileType)),
|
||||
).subscribe();
|
||||
|
||||
return {form: form, changeSubscription: changeSubscription};
|
||||
}
|
||||
|
||||
private attachSync(form: FormGroup, song: Song) {
|
||||
const controls = Object.keys(form.controls);
|
||||
controls.forEach(control => {
|
||||
form.controls[control].valueChanges
|
||||
.pipe(
|
||||
switchMap(value => this.songsService.patch$(song.ID, control, value)),
|
||||
)
|
||||
.subscribe();
|
||||
});
|
||||
}
|
||||
|
||||
private defaultValues(): Song {
|
||||
const song: Song = {
|
||||
ID: null,
|
||||
Number: this.firstFreeNumber(),
|
||||
Name: null,
|
||||
Tempo: null,
|
||||
Text: null,
|
||||
SongType: null,
|
||||
Key: null,
|
||||
Comments: null,
|
||||
Final: false,
|
||||
Files: []
|
||||
};
|
||||
|
||||
return song;
|
||||
}
|
||||
|
||||
private firstFreeNumber(): number {
|
||||
let number = 0;
|
||||
const numbers = this.songsService.songs.value.data.map(_ => _.Number);
|
||||
while (numbers.indexOf(++number) !== -1) {
|
||||
}
|
||||
return number;
|
||||
}
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
import {HttpClient} from '@angular/common/http';
|
||||
import {Injectable} from '@angular/core';
|
||||
import {ODataService} from 'odata-v4-ng';
|
||||
import {ODataBaseService} from './ODataBaseService';
|
||||
import {Song} from '../songs/models/song.model';
|
||||
import {BehaviorSubject, Observable} from 'rxjs';
|
||||
import {tap} from 'rxjs/operators';
|
||||
import {State} from './state';
|
||||
import {FileType} from '../songs/models/files-types.model';
|
||||
import {environment} from '../../environments/environment';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class SongsService extends ODataBaseService {
|
||||
public state = new BehaviorSubject<State>(State.list);
|
||||
|
||||
public songs = new BehaviorSubject<{ count: number, data: Song[] }>({count: 0, data: []});
|
||||
|
||||
constructor(odataService: ODataService, private httpClient: HttpClient) {
|
||||
super(odataService, 'songs');
|
||||
}
|
||||
|
||||
public loadSongList$(page: number, pageSize: number): Observable<{ count: number, data: Song[] }> {
|
||||
const properties = ['ID', 'Name', 'Number', 'SongType', 'Key', 'Tempo'];
|
||||
const list = this.list$<Song>(properties, page * pageSize, pageSize).pipe(
|
||||
tap(_ => this.songs.next(_))
|
||||
);
|
||||
return list;
|
||||
}
|
||||
|
||||
public patch$(id: number, control: string, value: any): Observable<boolean> {
|
||||
const patch = super.patch$(id, control, value).pipe(
|
||||
tap(() => {
|
||||
const songs = this.songs.value;
|
||||
const song = songs.data.filter(_ => _.ID === id)[0];
|
||||
song[control] = value;
|
||||
this.songs.next(songs);
|
||||
})
|
||||
);
|
||||
|
||||
return patch;
|
||||
}
|
||||
|
||||
public saveNewSong$(values: any): Observable<Song> {
|
||||
const newSong = super.post$<Song>(values);
|
||||
|
||||
return newSong;
|
||||
}
|
||||
|
||||
public updateFile$(
|
||||
songId: number,
|
||||
fileId: number,
|
||||
name: string,
|
||||
fileType: FileType
|
||||
): Observable<any> {
|
||||
const url = `${environment.api}/api/songs/${songId}/files/${fileId}/edit?Name=${name}&FileType=${fileType}`;
|
||||
const get = this.httpClient.get(url);
|
||||
return get;
|
||||
}
|
||||
|
||||
public deleteFile$(
|
||||
songId: number,
|
||||
fileId: number
|
||||
): Observable<any> {
|
||||
const url = `${environment.api}/api/songs/${songId}/files/${fileId}/delete`;
|
||||
const get = this.httpClient.get(url);
|
||||
return get;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
export enum State {
|
||||
read,
|
||||
edit,
|
||||
new,
|
||||
list
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
import {inject, TestBed} from '@angular/core/testing';
|
||||
|
||||
import {AuthGuard} from './auth.guard';
|
||||
|
||||
describe('AuthGuard', () => {
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
providers: [AuthGuard]
|
||||
});
|
||||
});
|
||||
|
||||
it('should ...', inject([AuthGuard], (guard: AuthGuard) => {
|
||||
expect(guard).toBeTruthy();
|
||||
}));
|
||||
});
|
||||
@@ -1,27 +0,0 @@
|
||||
import {Injectable} from '@angular/core';
|
||||
import {ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot, UrlTree} from '@angular/router';
|
||||
import {AuthService} from '../services/auth.service';
|
||||
import {Observable} from 'rxjs';
|
||||
import {map} from 'rxjs/operators';
|
||||
import {Role} from '../services/roles.model';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class AuthGuard implements CanActivate {
|
||||
|
||||
constructor(private authService: AuthService,
|
||||
private router: Router
|
||||
) {
|
||||
}
|
||||
|
||||
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean | UrlTree> {
|
||||
return this.authService.userMay$(Role.reader).pipe(
|
||||
map(_ => {
|
||||
return _
|
||||
? true
|
||||
: this.router.createUrlTree(['/account/login'], {queryParams: {redirect: route.url}});
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
import {async, TestBed} from '@angular/core/testing';
|
||||
|
||||
import {AccessRightService} from './access-right.service';
|
||||
import {AngularFirestore} from '@angular/fire/firestore';
|
||||
import {of} from 'rxjs';
|
||||
import {Role} from './roles.model';
|
||||
|
||||
describe('AccessRightService', () => {
|
||||
const mockAngularFirestore = {
|
||||
collection: () => ({
|
||||
doc: () => ({
|
||||
valueChanges: () => of({
|
||||
role: 'reader'
|
||||
})
|
||||
})
|
||||
})
|
||||
};
|
||||
|
||||
beforeEach(() => TestBed.configureTestingModule({
|
||||
providers: [
|
||||
{provide: AngularFirestore, useValue: mockAngularFirestore}
|
||||
]
|
||||
}));
|
||||
|
||||
it('should be created', () => {
|
||||
const service: AccessRightService = TestBed.get(AccessRightService);
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should get user', async(() => {
|
||||
const service: AccessRightService = TestBed.get(AccessRightService);
|
||||
service.getUserInfo('userid').subscribe(_ => {
|
||||
expect(_).toEqual({
|
||||
user: 'userid',
|
||||
role: Role.reader
|
||||
});
|
||||
});
|
||||
}));
|
||||
|
||||
|
||||
});
|
||||
@@ -1,43 +0,0 @@
|
||||
import {Injectable} from '@angular/core';
|
||||
import {AngularFirestore} from '@angular/fire/firestore';
|
||||
import {map} from 'rxjs/operators';
|
||||
import {User, UserDB} from './user.model';
|
||||
import {Observable, of} from 'rxjs';
|
||||
import {Role} from './roles.model';
|
||||
import {RoleDefinitions} from './role.definition';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class AccessRightService {
|
||||
|
||||
constructor(
|
||||
private angularFirestore: AngularFirestore
|
||||
) {
|
||||
}
|
||||
|
||||
public getUserInfo(userId: string): Observable<User> {
|
||||
if (userId === null) {
|
||||
return of(null);
|
||||
}
|
||||
|
||||
const user$ = this.angularFirestore
|
||||
.collection('/user')
|
||||
.doc<UserDB>(userId)
|
||||
.valueChanges()
|
||||
.pipe
|
||||
(map(user => ({
|
||||
user: userId,
|
||||
role: user.role
|
||||
})));
|
||||
|
||||
return user$;
|
||||
}
|
||||
|
||||
public userMay(role: Role, requestedRole: Role): boolean {
|
||||
const allowedRoles = RoleDefinitions.filter(_ => _.role === requestedRole)[0].when;
|
||||
const isAllowed = allowedRoles.indexOf(role) !== -1;
|
||||
|
||||
return isAllowed;
|
||||
}
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
import {fakeAsync, TestBed, tick} from '@angular/core/testing';
|
||||
|
||||
import {AuthService} from './auth.service';
|
||||
import {of} from 'rxjs';
|
||||
import {Role} from './roles.model';
|
||||
import {AccessRightService} from './access-right.service';
|
||||
import {AngularFireAuth} from '@angular/fire/auth';
|
||||
|
||||
describe('AuthService', () => {
|
||||
const mockAccessRightService = {
|
||||
getUserInfo: () => of({
|
||||
user: 'userid',
|
||||
role: Role.reader
|
||||
})
|
||||
};
|
||||
const mockAngularFireAuth = {
|
||||
auth: {
|
||||
signInWithEmailAndPassword: Promise.resolve({user: {uid: 'userid'}})
|
||||
}
|
||||
};
|
||||
beforeEach(() => TestBed.configureTestingModule({
|
||||
providers: [
|
||||
{provide: AccessRightService, useValue: mockAccessRightService},
|
||||
{provide: AngularFireAuth, useValue: mockAngularFireAuth},
|
||||
]
|
||||
}));
|
||||
|
||||
it('should be created', () => {
|
||||
const service: AuthService = TestBed.get(AuthService);
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should be created', fakeAsync(() => {
|
||||
const service: AuthService = TestBed.get(AuthService);
|
||||
const authSpy = spyOn(TestBed.get(AngularFireAuth).auth, 'signInWithEmailAndPassword');
|
||||
const accessSpy = spyOn(TestBed.get(AccessRightService), 'getUserInfo');
|
||||
service.login$('user', 'pass');
|
||||
|
||||
expect(authSpy).toHaveBeenCalledWith('user', 'pass');
|
||||
tick();
|
||||
expect(accessSpy).toHaveBeenCalledWith('userid');
|
||||
tick();
|
||||
expect(service.user.user).toBe('userid');
|
||||
expect(service.user.user).toBe(Role.reader);
|
||||
|
||||
}));
|
||||
});
|
||||
@@ -1,64 +0,0 @@
|
||||
import {Injectable} from '@angular/core';
|
||||
import {AngularFireAuth} from '@angular/fire/auth';
|
||||
import {from, Observable, of, OperatorFunction} from 'rxjs';
|
||||
import {AccessRightService} from './access-right.service';
|
||||
import {catchError, map, switchMap, tap} from 'rxjs/operators';
|
||||
import {User} from './user.model';
|
||||
import {Role} from './roles.model';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class AuthService {
|
||||
private _user: User = null;
|
||||
|
||||
constructor(
|
||||
private angularFireAuth: AngularFireAuth,
|
||||
private accessRightService: AccessRightService
|
||||
) {
|
||||
angularFireAuth.authState.subscribe(_ => console.log(_));
|
||||
}
|
||||
|
||||
public login$(user: string, pass: string): Observable<User> {
|
||||
const authPromise = this.angularFireAuth.auth.signInWithEmailAndPassword(user, pass);
|
||||
const auth$ = from(authPromise).pipe(
|
||||
map(_ => _.user.uid),
|
||||
this.processLogin()
|
||||
);
|
||||
|
||||
return auth$;
|
||||
}
|
||||
|
||||
public getUser$(): Observable<User> {
|
||||
if (this._user) {
|
||||
return of(this._user);
|
||||
}
|
||||
|
||||
return this.angularFireAuth.authState.pipe(
|
||||
map(_ => _ ? _.uid : null),
|
||||
this.processLogin()
|
||||
);
|
||||
}
|
||||
|
||||
public userMay$(requestedRole: Role): Observable<boolean> {
|
||||
const allowed$ = this.getUser$().pipe(
|
||||
map(_ => _ ? this.accessRightService.userMay(_.role, requestedRole) : false)
|
||||
);
|
||||
|
||||
return allowed$;
|
||||
}
|
||||
|
||||
private processLogin(): OperatorFunction<string, User> {
|
||||
const self = this;
|
||||
return function (source$: Observable<string>): Observable<User> {
|
||||
return source$.pipe(
|
||||
switchMap(_ => self.accessRightService.getUserInfo(_)),
|
||||
tap((_ => self._user = _)),
|
||||
catchError(_ => {
|
||||
self._user = null;
|
||||
return of(null);
|
||||
})
|
||||
);
|
||||
};
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user