From bbe9f33571f8e3673b7fe6fc799196602b5d7bbb Mon Sep 17 00:00:00 2001 From: Benjamin Ifland Date: Sun, 17 Mar 2019 17:32:25 +0100 Subject: [PATCH] creating oData client testing odata interface --- API/API.Client.Test/API.Client.Test.csproj | 108 ++++++++++++++++++ API/API.Client.Test/OdataTests.cs | 93 +++++++++++++++ .../Properties/AssemblyInfo.cs | 20 ++++ API/API.Client.Test/packages.config | 12 ++ API/API.Client/API.Client.csproj | 91 +++++++++++++++ API/API.Client/Client.cs | 44 +++++++ API/API.Client/Expresseion.cs | 4 + API/API.Client/Properties/AssemblyInfo.cs | 36 ++++++ API/API.Client/packages.config | 10 ++ API/API.sln | 25 ++++ API/API/API.csproj | 18 ++- API/API/App_Start/WebApiConfig.cs | 3 +- API/API/Controllers/SongsController.cs | 12 +- API/API/Database/DataContext.cs | 5 +- API/API/Web.config | 2 +- API/Models/API.Models.csproj | 54 +++++++++ API/{API/Database/Model => Models}/Access.cs | 2 +- API/{API/Database/Model => Models}/Change.cs | 2 +- API/{API/Database/Model => Models}/File.cs | 2 +- .../Database/Model => Models}/FileType.cs | 2 +- API/Models/Properties/AssemblyInfo.cs | 36 ++++++ API/{API/Database/Model => Models}/Song.cs | 2 +- .../Database/Model => Models}/SongType.cs | 2 +- API/{API/Database/Model => Models}/User.cs | 2 +- 24 files changed, 566 insertions(+), 21 deletions(-) create mode 100644 API/API.Client.Test/API.Client.Test.csproj create mode 100644 API/API.Client.Test/OdataTests.cs create mode 100644 API/API.Client.Test/Properties/AssemblyInfo.cs create mode 100644 API/API.Client.Test/packages.config create mode 100644 API/API.Client/API.Client.csproj create mode 100644 API/API.Client/Client.cs create mode 100644 API/API.Client/Expresseion.cs create mode 100644 API/API.Client/Properties/AssemblyInfo.cs create mode 100644 API/API.Client/packages.config create mode 100644 API/Models/API.Models.csproj rename API/{API/Database/Model => Models}/Access.cs (73%) rename API/{API/Database/Model => Models}/Change.cs (89%) rename API/{API/Database/Model => Models}/File.cs (87%) rename API/{API/Database/Model => Models}/FileType.cs (74%) create mode 100644 API/Models/Properties/AssemblyInfo.cs rename API/{API/Database/Model => Models}/Song.cs (93%) rename API/{API/Database/Model => Models}/SongType.cs (66%) rename API/{API/Database/Model => Models}/User.cs (90%) diff --git a/API/API.Client.Test/API.Client.Test.csproj b/API/API.Client.Test/API.Client.Test.csproj new file mode 100644 index 0000000..2c32946 --- /dev/null +++ b/API/API.Client.Test/API.Client.Test.csproj @@ -0,0 +1,108 @@ + + + + + + Debug + AnyCPU + {52BDCA0E-DC33-4398-BB6F-485CB07DE980} + Library + Properties + API.Client.Test + API.Client.Test + v4.6.2 + 512 + {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 15.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages + False + UnitTest + + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\Microsoft.Data.Edm.5.8.4\lib\net40\Microsoft.Data.Edm.dll + + + ..\packages\Microsoft.Data.OData.5.8.4\lib\net40\Microsoft.Data.OData.dll + + + ..\packages\Microsoft.OData.Core.7.5.3\lib\portable-net45+win8+wpa81\Microsoft.OData.Core.dll + + + ..\packages\Microsoft.OData.Edm.7.5.3\lib\portable-net45+win8+wpa81\Microsoft.OData.Edm.dll + + + ..\packages\Microsoft.Spatial.7.5.3\lib\portable-net45+win8+wpa81\Microsoft.Spatial.dll + + + ..\packages\MSTest.TestFramework.1.3.2\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll + + + ..\packages\MSTest.TestFramework.1.3.2\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll + + + ..\packages\Simple.OData.Client.5.6.2\lib\net452\Simple.OData.Client.Core.dll + + + ..\packages\Simple.OData.Client.5.6.2\lib\net452\Simple.OData.Client.Dynamic.dll + + + ..\packages\Simple.OData.Client.5.6.2\lib\net452\Simple.OData.Client.V3.Adapter.dll + + + ..\packages\Simple.OData.Client.5.6.2\lib\net452\Simple.OData.Client.V4.Adapter.dll + + + + + ..\packages\System.Spatial.5.8.4\lib\net40\System.Spatial.dll + + + + + + + + + + + + {88db6691-8ee1-428c-8da4-50342aeb2c54} + API.Client + + + {8d72ff7d-c085-4c06-9d66-9537b7ac924d} + API.Models + + + + + + + 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}. + + + + + + \ No newline at end of file diff --git a/API/API.Client.Test/OdataTests.cs b/API/API.Client.Test/OdataTests.cs new file mode 100644 index 0000000..4e4a95f --- /dev/null +++ b/API/API.Client.Test/OdataTests.cs @@ -0,0 +1,93 @@ +using System; +using System.Linq; +using System.Net; +using System.Threading.Tasks; +using API.Models; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Simple.OData.Client; + +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 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); + + var count = await client.Delete(response.ID); + Assert.AreEqual(1, count); + + try { + await client.Get(response.ID); + Assert.Fail("WebRequestException not thrown"); + } catch (WebRequestException ex) { + Assert.AreEqual(HttpStatusCode.NotFound, ex.Code); + } + + } + + + } +} diff --git a/API/API.Client.Test/Properties/AssemblyInfo.cs b/API/API.Client.Test/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..f7a8db4 --- /dev/null +++ b/API/API.Client.Test/Properties/AssemblyInfo.cs @@ -0,0 +1,20 @@ +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")] diff --git a/API/API.Client.Test/packages.config b/API/API.Client.Test/packages.config new file mode 100644 index 0000000..8bb21e8 --- /dev/null +++ b/API/API.Client.Test/packages.config @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/API/API.Client/API.Client.csproj b/API/API.Client/API.Client.csproj new file mode 100644 index 0000000..1db0940 --- /dev/null +++ b/API/API.Client/API.Client.csproj @@ -0,0 +1,91 @@ + + + + + Debug + AnyCPU + {88DB6691-8EE1-428C-8DA4-50342AEB2C54} + Library + Properties + API.Client + API.Client + v4.6.2 + 512 + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\Microsoft.Data.Edm.5.8.4\lib\net40\Microsoft.Data.Edm.dll + + + ..\packages\Microsoft.Data.OData.5.8.4\lib\net40\Microsoft.Data.OData.dll + + + ..\packages\Microsoft.OData.Core.7.5.3\lib\portable-net45+win8+wpa81\Microsoft.OData.Core.dll + + + ..\packages\Microsoft.OData.Edm.7.5.3\lib\portable-net45+win8+wpa81\Microsoft.OData.Edm.dll + + + ..\packages\Microsoft.Spatial.7.5.3\lib\portable-net45+win8+wpa81\Microsoft.Spatial.dll + + + ..\packages\Simple.OData.Client.5.6.2\lib\net452\Simple.OData.Client.Core.dll + + + ..\packages\Simple.OData.Client.5.6.2\lib\net452\Simple.OData.Client.Dynamic.dll + + + ..\packages\Simple.OData.Client.5.6.2\lib\net452\Simple.OData.Client.V3.Adapter.dll + + + ..\packages\Simple.OData.Client.5.6.2\lib\net452\Simple.OData.Client.V4.Adapter.dll + + + + + ..\packages\System.Spatial.5.8.4\lib\net40\System.Spatial.dll + + + + + + + + + + + + + + + + + + + + + + {8d72ff7d-c085-4c06-9d66-9537b7ac924d} + API.Models + + + + \ No newline at end of file diff --git a/API/API.Client/Client.cs b/API/API.Client/Client.cs new file mode 100644 index 0000000..8650ccc --- /dev/null +++ b/API/API.Client/Client.cs @@ -0,0 +1,44 @@ + +using API.Models; +using Simple.OData.Client; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Threading.Tasks; + +namespace API.Client { + public class Client { + + public async Task> Get() { + var client = new ODataClient("http://localhost/API/odata").For(); + var songs = await client.FindEntriesAsync(); + return songs; + } + + public async Task> Get(Expression> filterExpression) { + var client = new ODataClient("http://localhost/API/odata").For(); + var songs = await client.Filter(filterExpression).FindEntriesAsync(); + return songs; + } + + public async Task Get(long id) { + var client = new ODataClient("http://localhost/API/odata").For(); + var song = await client.Key(id).FindEntryAsync(); + return song; + } + + public async Task Post(Song song) { + var client = new ODataClient("http://localhost/API/odata").For(); + var insertedSong = await client.Set(song).InsertEntryAsync(); + return insertedSong; + } + + public async Task Delete(long id) { + var client = new ODataClient("http://localhost/API/odata").For(); + var count = await client.Key(id).DeleteEntriesAsync(); + return count; + } + } + + +} diff --git a/API/API.Client/Expresseion.cs b/API/API.Client/Expresseion.cs new file mode 100644 index 0000000..4a2547c --- /dev/null +++ b/API/API.Client/Expresseion.cs @@ -0,0 +1,4 @@ +namespace API.Client { + public class Expression { + } +} \ No newline at end of file diff --git a/API/API.Client/Properties/AssemblyInfo.cs b/API/API.Client/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..da75e95 --- /dev/null +++ b/API/API.Client/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("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")] diff --git a/API/API.Client/packages.config b/API/API.Client/packages.config new file mode 100644 index 0000000..1d94e43 --- /dev/null +++ b/API/API.Client/packages.config @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/API/API.sln b/API/API.sln index 1dd5c95..3e0f28b 100644 --- a/API/API.sln +++ b/API/API.sln @@ -9,6 +9,16 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "API.Test", "API.Test\API.Te 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 Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -23,6 +33,18 @@ Global {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 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -30,6 +52,9 @@ Global 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} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {27650156-7B3F-4C0C-83D3-D13119DE083F} diff --git a/API/API/API.csproj b/API/API/API.csproj index f36a8ac..ae70463 100644 --- a/API/API/API.csproj +++ b/API/API/API.csproj @@ -15,7 +15,7 @@ API v4.6.2 false - true + false @@ -130,13 +130,6 @@ - - - - - - - Global.asax @@ -160,7 +153,12 @@ Web.config - + + + {8d72ff7d-c085-4c06-9d66-9537b7ac924d} + API.Models + + @@ -187,7 +185,7 @@ True 50752 / - http://localhost:50752/ + http://localhost/API False False diff --git a/API/API/App_Start/WebApiConfig.cs b/API/API/App_Start/WebApiConfig.cs index 4a3fb33..bcc57a9 100644 --- a/API/API/App_Start/WebApiConfig.cs +++ b/API/API/App_Start/WebApiConfig.cs @@ -1,5 +1,5 @@ using API.App_Start; -using API.Database.Model; +using API.Models; using Microsoft.AspNet.OData.Builder; using Microsoft.AspNet.OData.Extensions; using System.Net.Http.Headers; @@ -22,6 +22,7 @@ namespace API { // Web API oData configuration var builder = new ODataConventionModelBuilder(); builder.EntitySet("songs"); + config.Count().Filter().OrderBy().Expand().Select().MaxTop(null); config.MapODataServiceRoute( routeName: "songs", routePrefix: "odata", diff --git a/API/API/Controllers/SongsController.cs b/API/API/Controllers/SongsController.cs index ce72cb7..9c410b0 100644 --- a/API/API/Controllers/SongsController.cs +++ b/API/API/Controllers/SongsController.cs @@ -1,9 +1,10 @@ using API.Database; -using API.Database.Model; +using API.Models; 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 { @@ -73,6 +74,15 @@ namespace ProductService.Controllers { return Updated(update); } + public async Task Delete([FromODataUri] int key) { + var product = await db.Songs.FindAsync(key); + if (product == null) { + return NotFound(); + } + db.Songs.Remove(product); + await db.SaveChangesAsync(); + return StatusCode(HttpStatusCode.NoContent); + } } } \ No newline at end of file diff --git a/API/API/Database/DataContext.cs b/API/API/Database/DataContext.cs index 1543164..61d21dc 100644 --- a/API/API/Database/DataContext.cs +++ b/API/API/Database/DataContext.cs @@ -1,8 +1,11 @@ -using API.Database.Model; +using API.Models; using System.Data.Entity; namespace API.Database { public class DataContext : DbContext { + + public DataContext() : base("DataContext") { } + public DbSet Songs { get; set; } public DbSet Changes { get; set; } public DbSet Files { get; set; } diff --git a/API/API/Web.config b/API/API/Web.config index d940b1d..0b9b72e 100644 --- a/API/API/Web.config +++ b/API/API/Web.config @@ -9,7 +9,7 @@
- + diff --git a/API/Models/API.Models.csproj b/API/Models/API.Models.csproj new file mode 100644 index 0000000..d944b0b --- /dev/null +++ b/API/Models/API.Models.csproj @@ -0,0 +1,54 @@ + + + + + Debug + AnyCPU + {8D72FF7D-C085-4C06-9D66-9537B7AC924D} + Library + Properties + Models + Models + v4.6.2 + 512 + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/API/API/Database/Model/Access.cs b/API/Models/Access.cs similarity index 73% rename from API/API/Database/Model/Access.cs rename to API/Models/Access.cs index 6cf873f..74d67b5 100644 --- a/API/API/Database/Model/Access.cs +++ b/API/Models/Access.cs @@ -1,4 +1,4 @@ -namespace API.Database.Model { +namespace API.Models { public enum Access { Inactive, Reader, diff --git a/API/API/Database/Model/Change.cs b/API/Models/Change.cs similarity index 89% rename from API/API/Database/Model/Change.cs rename to API/Models/Change.cs index 2c5c5bd..2aec3da 100644 --- a/API/API/Database/Model/Change.cs +++ b/API/Models/Change.cs @@ -1,6 +1,6 @@ using System; -namespace API.Database.Model { +namespace API.Models { public class Change { public int ID { get; set; } public int UserId { get; set; } diff --git a/API/API/Database/Model/File.cs b/API/Models/File.cs similarity index 87% rename from API/API/Database/Model/File.cs rename to API/Models/File.cs index b6f2c83..97c8e08 100644 --- a/API/API/Database/Model/File.cs +++ b/API/Models/File.cs @@ -1,6 +1,6 @@ using System; -namespace API.Database.Model { +namespace API.Models { public class File { public int ID { get; set; } public Guid ReferenceFile { get; set; } diff --git a/API/API/Database/Model/FileType.cs b/API/Models/FileType.cs similarity index 74% rename from API/API/Database/Model/FileType.cs rename to API/Models/FileType.cs index 5843865..3f81ca6 100644 --- a/API/API/Database/Model/FileType.cs +++ b/API/Models/FileType.cs @@ -1,4 +1,4 @@ -namespace API.Database.Model { +namespace API.Models { public enum FileType { None, Sheet, diff --git a/API/Models/Properties/AssemblyInfo.cs b/API/Models/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..09003a9 --- /dev/null +++ b/API/Models/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("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")] diff --git a/API/API/Database/Model/Song.cs b/API/Models/Song.cs similarity index 93% rename from API/API/Database/Model/Song.cs rename to API/Models/Song.cs index a733681..0c9fc34 100644 --- a/API/API/Database/Model/Song.cs +++ b/API/Models/Song.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace API.Database.Model { +namespace API.Models { public class Song { public int ID { get; set; } public string Name { get; set; } diff --git a/API/API/Database/Model/SongType.cs b/API/Models/SongType.cs similarity index 66% rename from API/API/Database/Model/SongType.cs rename to API/Models/SongType.cs index 551f0ea..046bf06 100644 --- a/API/API/Database/Model/SongType.cs +++ b/API/Models/SongType.cs @@ -1,4 +1,4 @@ -namespace API.Database.Model { +namespace API.Models { public enum SongType { Praise, Worship diff --git a/API/API/Database/Model/User.cs b/API/Models/User.cs similarity index 90% rename from API/API/Database/Model/User.cs rename to API/Models/User.cs index b9371a1..d7ab2f2 100644 --- a/API/API/Database/Model/User.cs +++ b/API/Models/User.cs @@ -1,4 +1,4 @@ -namespace API.Database.Model { +namespace API.Models { public class User { public int ID { get; set; } public string Account { get; set; }