diff --git a/BuildFeed.Model/Build.cs b/BuildFeed.Model/Build.cs index 313f669..b587323 100644 --- a/BuildFeed.Model/Build.cs +++ b/BuildFeed.Model/Build.cs @@ -11,7 +11,6 @@ using Required = System.ComponentModel.DataAnnotations.RequiredAttribute; namespace BuildFeed.Model { - [DataObject] [BsonIgnoreExtraElements] public class Build : BuildDetails { @@ -155,27 +154,27 @@ namespace BuildFeed.Model private void GenerateFamily() { // start with lab-based overrides - if (Lab?.StartsWith("rs4", StringComparison.InvariantCultureIgnoreCase) ?? false) + if (Lab?.StartsWith("rs4", StringComparison.OrdinalIgnoreCase) ?? false) { Family = ProjectFamily.Redstone4; } - else if (Lab?.StartsWith("rs3", StringComparison.InvariantCultureIgnoreCase) ?? false) + else if (Lab?.StartsWith("rs3", StringComparison.OrdinalIgnoreCase) ?? false) { Family = ProjectFamily.Redstone3; } - else if (Lab?.StartsWith("feature2", StringComparison.InvariantCultureIgnoreCase) ?? false) + else if (Lab?.StartsWith("feature2", StringComparison.OrdinalIgnoreCase) ?? false) { Family = ProjectFamily.Feature2; } - else if (Lab?.StartsWith("rs2", StringComparison.InvariantCultureIgnoreCase) ?? false) + else if (Lab?.StartsWith("rs2", StringComparison.OrdinalIgnoreCase) ?? false) { Family = ProjectFamily.Redstone2; } - else if (Lab?.StartsWith("rs1", StringComparison.InvariantCultureIgnoreCase) ?? false) + else if (Lab?.StartsWith("rs1", StringComparison.OrdinalIgnoreCase) ?? false) { Family = ProjectFamily.Redstone; } - else if (Lab?.StartsWith("th2", StringComparison.InvariantCultureIgnoreCase) ?? false) + else if (Lab?.StartsWith("th2", StringComparison.OrdinalIgnoreCase) ?? false) { Family = ProjectFamily.Threshold2; } diff --git a/BuildFeed.Model/BuildDetails.cs b/BuildFeed.Model/BuildDetails.cs index 0fdf537..85a9e3c 100644 --- a/BuildFeed.Model/BuildDetails.cs +++ b/BuildFeed.Model/BuildDetails.cs @@ -1,6 +1,5 @@ using System; using System.ComponentModel.DataAnnotations; -using System.Web.Mvc; using BuildFeed.Local; using MongoDB.Bson.Serialization.Attributes; @@ -42,7 +41,7 @@ namespace BuildFeed.Model public TypeOfSource SourceType { get; set; } [Display(ResourceType = typeof(VariantTerms), Name = nameof(VariantTerms.Model_SourceDetails))] - [AllowHtml] + //[AllowHtml] public string SourceDetails { get; set; } [Display(ResourceType = typeof(VariantTerms), Name = nameof(VariantTerms.Model_LeakDate))] diff --git a/BuildFeed.Model/BuildFeed.Model.csproj b/BuildFeed.Model/BuildFeed.Model.csproj index e7f9f96..26ee50b 100644 --- a/BuildFeed.Model/BuildFeed.Model.csproj +++ b/BuildFeed.Model/BuildFeed.Model.csproj @@ -1,118 +1,19 @@ - - - + + - Debug - AnyCPU - {7E2B4F61-1C11-4471-AF80-5480E94C0664} - Library - Properties - BuildFeed.Model - BuildFeed.Model - v4.7.1 - 512 - - true - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 + netstandard2.0 + - - 6.2.2 - - - 1.8.1 - - - 5.2.4 - - - 3.2.4 - - - 3.2.4 - - - 2.6.0 - + + + + + + - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {9ebd4db1-1d37-456b-ad90-357aa89dd1b7} - BuildFeed.Local - - - - - \ No newline at end of file + + diff --git a/BuildFeed.Model/MetaItem.cs b/BuildFeed.Model/MetaItem.cs index b973e3b..077fa77 100644 --- a/BuildFeed.Model/MetaItem.cs +++ b/BuildFeed.Model/MetaItem.cs @@ -4,7 +4,6 @@ using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Threading.Tasks; -using System.Web.Mvc; using MongoDB.Bson; using MongoDB.Bson.Serialization.Attributes; using MongoDB.Driver; @@ -12,7 +11,6 @@ using Required = System.ComponentModel.DataAnnotations.RequiredAttribute; namespace BuildFeed.Model { - [DataObject] public class MetaItemModel { [Key] @@ -24,7 +22,7 @@ namespace BuildFeed.Model public string MetaDescription { get; set; } [DisplayName("Page Content")] - [AllowHtml] + //[AllowHtml] public string PageContent { get; set; } } @@ -55,24 +53,21 @@ namespace BuildFeed.Model _bModel = new BuildRepository(); } - [DataObjectMethod(DataObjectMethodType.Select, false)] + public async Task> Select() => await _metaCollection.Find(new BsonDocument()).ToListAsync(); - [DataObjectMethod(DataObjectMethodType.Select, true)] public async Task> SelectByType(MetaType type) { return await _metaCollection.Find(f => f.Id.Type == type).ToListAsync(); } - [DataObjectMethod(DataObjectMethodType.Select, false)] public async Task SelectById(MetaItemKey id) { return await _metaCollection.Find(f => f.Id.Type == id.Type && f.Id.Value == id.Value) .SingleOrDefaultAsync(); } - [DataObjectMethod(DataObjectMethodType.Select, false)] public async Task> SelectUnusedLabs() { var labs = await _bModel.SelectAllLabs(); @@ -84,7 +79,6 @@ namespace BuildFeed.Model select l; } - [DataObjectMethod(DataObjectMethodType.Select, false)] public async Task> SelectUnusedVersions() { var versions = await _bModel.SelectAllVersions(); @@ -96,7 +90,6 @@ namespace BuildFeed.Model select v.ToString(); } - [DataObjectMethod(DataObjectMethodType.Select, false)] public async Task> SelectUnusedYears() { var years = await _bModel.SelectAllYears(); @@ -108,7 +101,6 @@ namespace BuildFeed.Model select y.ToString(); } - [DataObjectMethod(DataObjectMethodType.Select, false)] public async Task> SelectUnusedFamilies() { var families = await _bModel.SelectAllFamilies(); @@ -120,25 +112,21 @@ namespace BuildFeed.Model select y.ToString(); } - [DataObjectMethod(DataObjectMethodType.Insert, true)] public async Task Insert(MetaItemModel item) { await _metaCollection.InsertOneAsync(item); } - [DataObjectMethod(DataObjectMethodType.Update, true)] public async Task Update(MetaItemModel item) { await _metaCollection.ReplaceOneAsync(f => f.Id.Type == item.Id.Type && f.Id.Value == item.Id.Value, item); } - [DataObjectMethod(DataObjectMethodType.Insert, false)] public async Task InsertAll(IEnumerable items) { await _metaCollection.InsertManyAsync(items); } - [DataObjectMethod(DataObjectMethodType.Delete, true)] public async Task DeleteById(MetaItemKey id) { await _metaCollection.DeleteOneAsync(f => f.Id.Type == id.Type && f.Id.Value == id.Value); diff --git a/BuildFeed.Model/View/SitemapData.cs b/BuildFeed.Model/View/SitemapData.cs deleted file mode 100644 index e610007..0000000 --- a/BuildFeed.Model/View/SitemapData.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Web.Routing; - -namespace BuildFeed.Model.View -{ - public class SitemapData - { - public Dictionary Actions { get; set; } - public SitemapDataBuildGroup[] Builds { get; set; } - - public string[] Labs { get; set; } - } - - public class SitemapDataBuildGroup - { - public SitemapDataBuild[] Builds { get; set; } - public BuildGroup Id { get; set; } - } - - public class SitemapDataBuild - { - public Guid Id { get; set; } - public string Name { get; set; } - } - - public class SitemapPagedAction - { - public string Action => UrlParams["action"].ToString(); - - public string Name { get; set; } - public int Pages { get; set; } - - public string UniqueId => UrlParams.GetHashCode().ToString("X8").ToLower(); - - public RouteValueDictionary UrlParams { get; set; } - } -} \ No newline at end of file diff --git a/BuildFeed.Model/app.config b/BuildFeed.Model/app.config deleted file mode 100644 index ac76913..0000000 --- a/BuildFeed.Model/app.config +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/BuildFeed.Model/View/AddBulk.cs b/BuildFeed.ViewModel/AddBulk.cs similarity index 80% rename from BuildFeed.Model/View/AddBulk.cs rename to BuildFeed.ViewModel/AddBulk.cs index f3993ca..71739ff 100644 --- a/BuildFeed.Model/View/AddBulk.cs +++ b/BuildFeed.ViewModel/AddBulk.cs @@ -1,4 +1,4 @@ -namespace BuildFeed.Model.View +namespace BuildFeed.ViewModel { public class BulkAddition { diff --git a/BuildFeed.ViewModel/BuildFeed.ViewModel.csproj b/BuildFeed.ViewModel/BuildFeed.ViewModel.csproj new file mode 100644 index 0000000..843d2bb --- /dev/null +++ b/BuildFeed.ViewModel/BuildFeed.ViewModel.csproj @@ -0,0 +1,68 @@ + + + + + Debug + AnyCPU + {F70F4167-DB65-4DDB-94ED-1B9419D520A3} + Library + Properties + BuildFeed.ViewModel + BuildFeed.ViewModel + v4.7.1 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {9ebd4db1-1d37-456b-ad90-357aa89dd1b7} + BuildFeed.Local + + + {294e58eb-a6c6-4cad-b9f8-b70fc004037f} + BuildFeed.Model + + + + \ No newline at end of file diff --git a/BuildFeed.Model/View/ChangePassword.cs b/BuildFeed.ViewModel/ChangePassword.cs similarity index 95% rename from BuildFeed.Model/View/ChangePassword.cs rename to BuildFeed.ViewModel/ChangePassword.cs index 1b6b077..4783e46 100644 --- a/BuildFeed.Model/View/ChangePassword.cs +++ b/BuildFeed.ViewModel/ChangePassword.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using BuildFeed.Local; -namespace BuildFeed.Model.View +namespace BuildFeed.ViewModel { public class ChangePassword { diff --git a/BuildFeed.Model/View/FrontBuildGroup.cs b/BuildFeed.ViewModel/FrontBuildGroup.cs similarity index 78% rename from BuildFeed.Model/View/FrontBuildGroup.cs rename to BuildFeed.ViewModel/FrontBuildGroup.cs index ab0e9b0..35d3bcd 100644 --- a/BuildFeed.Model/View/FrontBuildGroup.cs +++ b/BuildFeed.ViewModel/FrontBuildGroup.cs @@ -1,6 +1,7 @@ using System; +using BuildFeed.Model; -namespace BuildFeed.Model.View +namespace BuildFeed.ViewModel { public class FrontBuildGroup { diff --git a/BuildFeed.ViewModel/FrontPage.cs b/BuildFeed.ViewModel/FrontPage.cs new file mode 100644 index 0000000..6404d37 --- /dev/null +++ b/BuildFeed.ViewModel/FrontPage.cs @@ -0,0 +1,11 @@ +namespace BuildFeed.ViewModel +{ + public class FrontPage + { + public FrontPageBuild CurrentCanary { get; set; } + public FrontPageBuild CurrentInsider { get; set; } + public FrontPageBuild CurrentRelease { get; set; } + public FrontPageBuild CurrentXbox { get; set; } + public FrontPageBuild CurrentAnalog { get; set; } + } +} \ No newline at end of file diff --git a/BuildFeed.Model/View/FrontPage.cs b/BuildFeed.ViewModel/FrontPageBuild.cs similarity index 75% rename from BuildFeed.Model/View/FrontPage.cs rename to BuildFeed.ViewModel/FrontPageBuild.cs index 7e22891..aa1fdb8 100644 --- a/BuildFeed.Model/View/FrontPage.cs +++ b/BuildFeed.ViewModel/FrontPageBuild.cs @@ -1,23 +1,12 @@ using System; using System.ComponentModel.DataAnnotations; using BuildFeed.Local; -using MongoDB.Bson.Serialization.Attributes; -namespace BuildFeed.Model.View +namespace BuildFeed.ViewModel { - public class FrontPage - { - public FrontPageBuild CurrentCanary { get; set; } - public FrontPageBuild CurrentInsider { get; set; } - public FrontPageBuild CurrentRelease { get; set; } - public FrontPageBuild CurrentXbox { get; set; } - public FrontPageBuild CurrentAnalog { get; set; } - } - public class FrontPageBuild { [Key] - [BsonId] public Guid Id { get; set; } [Required] diff --git a/BuildFeed.Model/View/LoginUser.cs b/BuildFeed.ViewModel/LoginUser.cs similarity index 94% rename from BuildFeed.Model/View/LoginUser.cs rename to BuildFeed.ViewModel/LoginUser.cs index 5019ba5..311f365 100644 --- a/BuildFeed.Model/View/LoginUser.cs +++ b/BuildFeed.ViewModel/LoginUser.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using BuildFeed.Local; -namespace BuildFeed.Model.View +namespace BuildFeed.ViewModel { public class LoginUser { diff --git a/BuildFeed.Model/Properties/AssemblyInfo.cs b/BuildFeed.ViewModel/Properties/AssemblyInfo.cs similarity index 73% rename from BuildFeed.Model/Properties/AssemblyInfo.cs rename to BuildFeed.ViewModel/Properties/AssemblyInfo.cs index 8e21a56..314a963 100644 --- a/BuildFeed.Model/Properties/AssemblyInfo.cs +++ b/BuildFeed.ViewModel/Properties/AssemblyInfo.cs @@ -1,39 +1,36 @@ using System.Reflection; +using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following +// 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("BuildFeed.Model")] +[assembly: AssemblyTitle("BuildFeed.ViewModel")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("BuildFeed.Model")] -[assembly: AssemblyCopyright("Copyright © 2013 - 2018, The BuildFeed Team")] +[assembly: AssemblyProduct("BuildFeed.ViewModel")] +[assembly: AssemblyCopyright("Copyright © 2018")] [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 +// 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("7e2b4f61-1c11-4471-af80-5480e94c0664")] +[assembly: Guid("f70f4167-db65-4ddb-94ed-1b9419d520a3")] // Version information for an assembly consists of the following four values: // // Major Version -// Minor Version +// Minor Version // Build Number // Revision // -// You can specify all the values or you can default the Build and Revision Numbers +// 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")] \ No newline at end of file +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/BuildFeed.Model/View/RegistrationUser.cs b/BuildFeed.ViewModel/RegistrationUser.cs similarity index 96% rename from BuildFeed.Model/View/RegistrationUser.cs rename to BuildFeed.ViewModel/RegistrationUser.cs index 2b86c59..67c03d3 100644 --- a/BuildFeed.Model/View/RegistrationUser.cs +++ b/BuildFeed.ViewModel/RegistrationUser.cs @@ -1,7 +1,7 @@ using System.ComponentModel.DataAnnotations; using BuildFeed.Local; -namespace BuildFeed.Model.View +namespace BuildFeed.ViewModel { public class RegistrationUser { diff --git a/BuildFeed.ViewModel/SitemapData.cs b/BuildFeed.ViewModel/SitemapData.cs new file mode 100644 index 0000000..4ff93b5 --- /dev/null +++ b/BuildFeed.ViewModel/SitemapData.cs @@ -0,0 +1,12 @@ +using System.Collections.Generic; + +namespace BuildFeed.ViewModel +{ + public class SitemapData + { + public Dictionary Actions { get; set; } + public SitemapDataBuildGroup[] Builds { get; set; } + + public string[] Labs { get; set; } + } +} \ No newline at end of file diff --git a/BuildFeed.ViewModel/SitemapDataBuild.cs b/BuildFeed.ViewModel/SitemapDataBuild.cs new file mode 100644 index 0000000..31677a0 --- /dev/null +++ b/BuildFeed.ViewModel/SitemapDataBuild.cs @@ -0,0 +1,10 @@ +using System; + +namespace BuildFeed.ViewModel +{ + public class SitemapDataBuild + { + public Guid Id { get; set; } + public string Name { get; set; } + } +} \ No newline at end of file diff --git a/BuildFeed.ViewModel/SitemapDataBuildGroup.cs b/BuildFeed.ViewModel/SitemapDataBuildGroup.cs new file mode 100644 index 0000000..8c00bd3 --- /dev/null +++ b/BuildFeed.ViewModel/SitemapDataBuildGroup.cs @@ -0,0 +1,10 @@ +using BuildFeed.Model; + +namespace BuildFeed.ViewModel +{ + public class SitemapDataBuildGroup + { + public SitemapDataBuild[] Builds { get; set; } + public BuildGroup Id { get; set; } + } +} \ No newline at end of file diff --git a/BuildFeed.ViewModel/SitemapPagedAction.cs b/BuildFeed.ViewModel/SitemapPagedAction.cs new file mode 100644 index 0000000..3da8fc0 --- /dev/null +++ b/BuildFeed.ViewModel/SitemapPagedAction.cs @@ -0,0 +1,16 @@ +using System.Collections.Generic; + +namespace BuildFeed.ViewModel +{ + public class SitemapPagedAction + { + public string Action => UrlParams["action"].ToString(); + + public string Name { get; set; } + public int Pages { get; set; } + + public string UniqueId => UrlParams.GetHashCode().ToString("X8").ToLower(); + + public Dictionary UrlParams { get; set; } + } +} \ No newline at end of file diff --git a/BuildFeed.sln b/BuildFeed.sln index a687b73..3b85d85 100644 --- a/BuildFeed.sln +++ b/BuildFeed.sln @@ -5,7 +5,6 @@ VisualStudioVersion = 15.0.27130.2010 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BuildFeed", "BuildFeed\BuildFeed.csproj", "{CDDCF754-ECAA-4A66-ADAA-62957A57A51B}" ProjectSection(ProjectDependencies) = postProject - {7E2B4F61-1C11-4471-AF80-5480E94C0664} = {7E2B4F61-1C11-4471-AF80-5480E94C0664} {7C67BFB9-1B3B-4676-A58D-10573DA82CFE} = {7C67BFB9-1B3B-4676-A58D-10573DA82CFE} EndProjectSection EndProject @@ -17,15 +16,17 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Authentication", "Authentic EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Mobile", "Mobile", "{2B646675-44D1-4722-8A86-8C64876C8FB7}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BuildFeed.Model", "BuildFeed.Model\BuildFeed.Model.csproj", "{7E2B4F61-1C11-4471-AF80-5480E94C0664}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{948A2168-A092-4958-A465-427271563061}" ProjectSection(SolutionItems) = preProject LICENSE.md = LICENSE.md README.md = README.md EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BuildFeed.Local", "BuildFeed.Local\BuildFeed.Local.csproj", "{9EBD4DB1-1D37-456B-AD90-357AA89DD1B7}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BuildFeed.Local", "BuildFeed.Local\BuildFeed.Local.csproj", "{9EBD4DB1-1D37-456B-AD90-357AA89DD1B7}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BuildFeed.Model", "BuildFeed.Model\BuildFeed.Model.csproj", "{294E58EB-A6C6-4CAD-B9F8-B70FC004037F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BuildFeed.ViewModel", "BuildFeed.ViewModel\BuildFeed.ViewModel.csproj", "{F70F4167-DB65-4DDB-94ED-1B9419D520A3}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -95,22 +96,6 @@ Global {5CAADB66-1FC2-4492-B766-36354687120D}.Release|x86.ActiveCfg = Release|x86 {5CAADB66-1FC2-4492-B766-36354687120D}.Release|x86.Build.0 = Release|x86 {5CAADB66-1FC2-4492-B766-36354687120D}.Release|x86.Deploy.0 = Release|x86 - {7E2B4F61-1C11-4471-AF80-5480E94C0664}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7E2B4F61-1C11-4471-AF80-5480E94C0664}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7E2B4F61-1C11-4471-AF80-5480E94C0664}.Debug|ARM.ActiveCfg = Debug|Any CPU - {7E2B4F61-1C11-4471-AF80-5480E94C0664}.Debug|ARM.Build.0 = Debug|Any CPU - {7E2B4F61-1C11-4471-AF80-5480E94C0664}.Debug|x64.ActiveCfg = Debug|Any CPU - {7E2B4F61-1C11-4471-AF80-5480E94C0664}.Debug|x64.Build.0 = Debug|Any CPU - {7E2B4F61-1C11-4471-AF80-5480E94C0664}.Debug|x86.ActiveCfg = Debug|Any CPU - {7E2B4F61-1C11-4471-AF80-5480E94C0664}.Debug|x86.Build.0 = Debug|Any CPU - {7E2B4F61-1C11-4471-AF80-5480E94C0664}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7E2B4F61-1C11-4471-AF80-5480E94C0664}.Release|Any CPU.Build.0 = Release|Any CPU - {7E2B4F61-1C11-4471-AF80-5480E94C0664}.Release|ARM.ActiveCfg = Release|Any CPU - {7E2B4F61-1C11-4471-AF80-5480E94C0664}.Release|ARM.Build.0 = Release|Any CPU - {7E2B4F61-1C11-4471-AF80-5480E94C0664}.Release|x64.ActiveCfg = Release|Any CPU - {7E2B4F61-1C11-4471-AF80-5480E94C0664}.Release|x64.Build.0 = Release|Any CPU - {7E2B4F61-1C11-4471-AF80-5480E94C0664}.Release|x86.ActiveCfg = Release|Any CPU - {7E2B4F61-1C11-4471-AF80-5480E94C0664}.Release|x86.Build.0 = Release|Any CPU {9EBD4DB1-1D37-456B-AD90-357AA89DD1B7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {9EBD4DB1-1D37-456B-AD90-357AA89DD1B7}.Debug|Any CPU.Build.0 = Debug|Any CPU {9EBD4DB1-1D37-456B-AD90-357AA89DD1B7}.Debug|ARM.ActiveCfg = Debug|Any CPU @@ -127,6 +112,38 @@ Global {9EBD4DB1-1D37-456B-AD90-357AA89DD1B7}.Release|x64.Build.0 = Release|Any CPU {9EBD4DB1-1D37-456B-AD90-357AA89DD1B7}.Release|x86.ActiveCfg = Release|Any CPU {9EBD4DB1-1D37-456B-AD90-357AA89DD1B7}.Release|x86.Build.0 = Release|Any CPU + {294E58EB-A6C6-4CAD-B9F8-B70FC004037F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {294E58EB-A6C6-4CAD-B9F8-B70FC004037F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {294E58EB-A6C6-4CAD-B9F8-B70FC004037F}.Debug|ARM.ActiveCfg = Debug|Any CPU + {294E58EB-A6C6-4CAD-B9F8-B70FC004037F}.Debug|ARM.Build.0 = Debug|Any CPU + {294E58EB-A6C6-4CAD-B9F8-B70FC004037F}.Debug|x64.ActiveCfg = Debug|Any CPU + {294E58EB-A6C6-4CAD-B9F8-B70FC004037F}.Debug|x64.Build.0 = Debug|Any CPU + {294E58EB-A6C6-4CAD-B9F8-B70FC004037F}.Debug|x86.ActiveCfg = Debug|Any CPU + {294E58EB-A6C6-4CAD-B9F8-B70FC004037F}.Debug|x86.Build.0 = Debug|Any CPU + {294E58EB-A6C6-4CAD-B9F8-B70FC004037F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {294E58EB-A6C6-4CAD-B9F8-B70FC004037F}.Release|Any CPU.Build.0 = Release|Any CPU + {294E58EB-A6C6-4CAD-B9F8-B70FC004037F}.Release|ARM.ActiveCfg = Release|Any CPU + {294E58EB-A6C6-4CAD-B9F8-B70FC004037F}.Release|ARM.Build.0 = Release|Any CPU + {294E58EB-A6C6-4CAD-B9F8-B70FC004037F}.Release|x64.ActiveCfg = Release|Any CPU + {294E58EB-A6C6-4CAD-B9F8-B70FC004037F}.Release|x64.Build.0 = Release|Any CPU + {294E58EB-A6C6-4CAD-B9F8-B70FC004037F}.Release|x86.ActiveCfg = Release|Any CPU + {294E58EB-A6C6-4CAD-B9F8-B70FC004037F}.Release|x86.Build.0 = Release|Any CPU + {F70F4167-DB65-4DDB-94ED-1B9419D520A3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F70F4167-DB65-4DDB-94ED-1B9419D520A3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F70F4167-DB65-4DDB-94ED-1B9419D520A3}.Debug|ARM.ActiveCfg = Debug|Any CPU + {F70F4167-DB65-4DDB-94ED-1B9419D520A3}.Debug|ARM.Build.0 = Debug|Any CPU + {F70F4167-DB65-4DDB-94ED-1B9419D520A3}.Debug|x64.ActiveCfg = Debug|Any CPU + {F70F4167-DB65-4DDB-94ED-1B9419D520A3}.Debug|x64.Build.0 = Debug|Any CPU + {F70F4167-DB65-4DDB-94ED-1B9419D520A3}.Debug|x86.ActiveCfg = Debug|Any CPU + {F70F4167-DB65-4DDB-94ED-1B9419D520A3}.Debug|x86.Build.0 = Debug|Any CPU + {F70F4167-DB65-4DDB-94ED-1B9419D520A3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F70F4167-DB65-4DDB-94ED-1B9419D520A3}.Release|Any CPU.Build.0 = Release|Any CPU + {F70F4167-DB65-4DDB-94ED-1B9419D520A3}.Release|ARM.ActiveCfg = Release|Any CPU + {F70F4167-DB65-4DDB-94ED-1B9419D520A3}.Release|ARM.Build.0 = Release|Any CPU + {F70F4167-DB65-4DDB-94ED-1B9419D520A3}.Release|x64.ActiveCfg = Release|Any CPU + {F70F4167-DB65-4DDB-94ED-1B9419D520A3}.Release|x64.Build.0 = Release|Any CPU + {F70F4167-DB65-4DDB-94ED-1B9419D520A3}.Release|x86.ActiveCfg = Release|Any CPU + {F70F4167-DB65-4DDB-94ED-1B9419D520A3}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/BuildFeed/App_Code/BuildHelpers.cshtml b/BuildFeed/App_Code/BuildHelpers.cshtml index 8766466..79272a3 100644 --- a/BuildFeed/App_Code/BuildHelpers.cshtml +++ b/BuildFeed/App_Code/BuildHelpers.cshtml @@ -1,4 +1,4 @@ -@using BuildFeed.Model.View +@using BuildFeed.ViewModel @helper LatestBuild(string title, FrontPageBuild build) {

@title

diff --git a/BuildFeed/BuildFeed.csproj b/BuildFeed/BuildFeed.csproj index cab2737..f629fa1 100644 --- a/BuildFeed/BuildFeed.csproj +++ b/BuildFeed/BuildFeed.csproj @@ -96,6 +96,9 @@ 0.3.0 + + 2.0.2 + 1.0.3 @@ -104,6 +107,9 @@ + + true + @@ -371,9 +377,13 @@ BuildFeed.Local - {7e2b4f61-1c11-4471-af80-5480e94c0664} + {294e58eb-a6c6-4cad-b9f8-b70fc004037f} BuildFeed.Model + + {f70f4167-db65-4ddb-94ed-1b9419d520a3} + BuildFeed.ViewModel + 10.0 diff --git a/BuildFeed/Controllers/AccountController.cs b/BuildFeed/Controllers/AccountController.cs index 93ffbdf..bddc7d6 100644 --- a/BuildFeed/Controllers/AccountController.cs +++ b/BuildFeed/Controllers/AccountController.cs @@ -5,7 +5,7 @@ using System.Web.Mvc; using System.Web.Security; using BuildFeed.Code; using BuildFeed.Local; -using BuildFeed.Model.View; +using BuildFeed.ViewModel; using MongoAuth; namespace BuildFeed.Controllers diff --git a/BuildFeed/Controllers/apiController.cs b/BuildFeed/Controllers/apiController.cs index 55c8858..a45cbf8 100644 --- a/BuildFeed/Controllers/apiController.cs +++ b/BuildFeed/Controllers/apiController.cs @@ -10,7 +10,7 @@ using BuildFeed.Code; using BuildFeed.Local; using BuildFeed.Model; using BuildFeed.Model.Api; -using BuildFeed.Model.View; +using BuildFeed.ViewModel; using OneSignal.RestAPIv3.Client; #pragma warning disable SG0016 // Controller method is vulnerable to CSRF - Not relevant for API diff --git a/BuildFeed/Controllers/frontController.cs b/BuildFeed/Controllers/frontController.cs index d3dd6a9..c7665c6 100644 --- a/BuildFeed/Controllers/frontController.cs +++ b/BuildFeed/Controllers/frontController.cs @@ -13,7 +13,7 @@ using System.Threading.Tasks; using System.Web.Mvc; using BuildFeed.Code; using BuildFeed.Model; -using BuildFeed.Model.View; +using BuildFeed.ViewModel; using OneSignal.RestAPIv3.Client; namespace BuildFeed.Controllers diff --git a/BuildFeed/Controllers/supportController.cs b/BuildFeed/Controllers/supportController.cs index 736f579..806d8e1 100644 --- a/BuildFeed/Controllers/supportController.cs +++ b/BuildFeed/Controllers/supportController.cs @@ -8,7 +8,7 @@ using System.Xml.Linq; using BuildFeed.Code; using BuildFeed.Local; using BuildFeed.Model; -using BuildFeed.Model.View; +using BuildFeed.ViewModel; namespace BuildFeed.Controllers { @@ -42,12 +42,12 @@ namespace BuildFeed.Controllers { new SitemapPagedAction { - UrlParams = new RouteValueDictionary(new + UrlParams = new Dictionary { - controller = "Front", - action = "Index", - page = 1 - }), + { "controller", "Front" }, + { "action", nameof(FrontController.Index) }, + { "page", 1 } + }, Pages = (builds.Count + (FrontController.PAGE_SIZE - 1)) / FrontController.PAGE_SIZE } } @@ -64,14 +64,14 @@ namespace BuildFeed.Controllers select new SitemapPagedAction { Name = $"{InvariantTerms.ProductName} {bv.Key.Major}.{bv.Key.Minor}", - UrlParams = new RouteValueDictionary(new + UrlParams = new Dictionary { - controller = "Front", - action = "ViewVersion", - major = bv.Key.Major, - minor = bv.Key.Minor, - page = 1 - }), + { "controller", "Front" }, + { "action", nameof(FrontController.ViewVersion) }, + { "major", bv.Key.Major }, + { "minor", bv.Key.Minor }, + { "page", 1 } + }, Pages = (bv.Count() + (FrontController.PAGE_SIZE - 1)) / FrontController.PAGE_SIZE }).ToArray() }, @@ -84,13 +84,13 @@ namespace BuildFeed.Controllers select new SitemapPagedAction { Name = bv.Key, - UrlParams = new RouteValueDictionary(new + UrlParams = new Dictionary { - controller = "Front", - action = "ViewLab", - lab = bv.Key, - page = 1 - }), + { "controller", "Front" }, + { "action", nameof(FrontController.ViewLab) }, + { "lab", bv.Key }, + { "page", 1 } + }, Pages = (bv.Count() + (FrontController.PAGE_SIZE - 1)) / FrontController.PAGE_SIZE }).ToArray() }, @@ -103,13 +103,13 @@ namespace BuildFeed.Controllers select new SitemapPagedAction { Name = bv.Key.ToString(), - UrlParams = new RouteValueDictionary(new + UrlParams = new Dictionary { - controller = "Front", - action = "ViewYear", - year = bv.Key, - page = 1 - }), + {"controller", "Front"}, + {"action", nameof(FrontController.ViewYear)}, + {"year", bv.Key}, + {"page", 1} + }, Pages = (bv.Count() + (FrontController.PAGE_SIZE - 1)) / FrontController.PAGE_SIZE }).ToArray() }, @@ -121,13 +121,13 @@ namespace BuildFeed.Controllers select new SitemapPagedAction { Name = MvcExtensions.GetDisplayTextForEnum(bv.Key), - UrlParams = new RouteValueDictionary(new + UrlParams = new Dictionary { - controller = "Front", - action = "ViewSource", - source = bv.Key, - page = 1 - }), + { "controller", "Front" }, + { "action", nameof(FrontController.ViewSource)}, + { "source", bv.Key }, + { "page", 1 } + }, Pages = (bv.Count() + (FrontController.PAGE_SIZE - 1)) / FrontController.PAGE_SIZE }).ToArray() } diff --git a/BuildFeed/Views/account/login.cshtml b/BuildFeed/Views/account/login.cshtml index 0b914c5..c213fbb 100644 --- a/BuildFeed/Views/account/login.cshtml +++ b/BuildFeed/Views/account/login.cshtml @@ -1,5 +1,5 @@ @using BuildFeed.Controllers -@using BuildFeed.Model.View +@using BuildFeed.ViewModel @model LoginUser @{ diff --git a/BuildFeed/Views/account/password.cshtml b/BuildFeed/Views/account/password.cshtml index 38a951e..606551b 100644 --- a/BuildFeed/Views/account/password.cshtml +++ b/BuildFeed/Views/account/password.cshtml @@ -1,4 +1,4 @@ -@using BuildFeed.Model.View +@using BuildFeed.ViewModel @model ChangePassword @{ diff --git a/BuildFeed/Views/account/register.cshtml b/BuildFeed/Views/account/register.cshtml index 85ba923..0380cd6 100644 --- a/BuildFeed/Views/account/register.cshtml +++ b/BuildFeed/Views/account/register.cshtml @@ -1,4 +1,4 @@ -@using BuildFeed.Model.View +@using BuildFeed.ViewModel @model RegistrationUser @{ diff --git a/BuildFeed/Views/front/AddBulk.cshtml b/BuildFeed/Views/front/AddBulk.cshtml index b190434..6268087 100644 --- a/BuildFeed/Views/front/AddBulk.cshtml +++ b/BuildFeed/Views/front/AddBulk.cshtml @@ -1,6 +1,6 @@ @using BuildFeed.Controllers @using BuildFeed.Model -@using BuildFeed.Model.View +@using BuildFeed.ViewModel @model BulkAddition @{ diff --git a/BuildFeed/Views/front/Pages.cshtml b/BuildFeed/Views/front/Pages.cshtml index 4f6f6a6..9910633 100644 --- a/BuildFeed/Views/front/Pages.cshtml +++ b/BuildFeed/Views/front/Pages.cshtml @@ -1,6 +1,6 @@ @using BuildFeed.Code @using BuildFeed.Controllers -@using BuildFeed.Model.View +@using BuildFeed.ViewModel @using Humanizer @model IEnumerable @{ diff --git a/BuildFeed/Views/front/index.cshtml b/BuildFeed/Views/front/index.cshtml index 6205e8a..8aa804d 100644 --- a/BuildFeed/Views/front/index.cshtml +++ b/BuildFeed/Views/front/index.cshtml @@ -1,7 +1,7 @@ @using BuildFeed.Code @using BuildFeed.Controllers @using BuildFeed.Model -@using BuildFeed.Model.View +@using BuildFeed.ViewModel @model Dictionary @{ ViewBag.Title = string.Format(VariantTerms.Front_HomeH1, InvariantTerms.SiteName); diff --git a/BuildFeed/Views/support/sitemap.cshtml b/BuildFeed/Views/support/sitemap.cshtml index dfdbe75..24da8a5 100644 --- a/BuildFeed/Views/support/sitemap.cshtml +++ b/BuildFeed/Views/support/sitemap.cshtml @@ -1,5 +1,5 @@ @using BuildFeed.Controllers -@using BuildFeed.Model.View +@using BuildFeed.ViewModel @model SitemapData @{ ViewBag.Title = $"{VariantTerms.Common_Sitemap} | {InvariantTerms.SiteName}"; @@ -52,7 +52,7 @@
  • @Html.ActionLink("Page 1", action.Action, action.UrlParams)
  • for (int i = 2; i <= action.Pages; i++) { - RouteValueDictionary urlParams = action.UrlParams; + var urlParams = action.UrlParams; urlParams["page"] = i;
  • @Html.ActionLink($"Page {i}", action.Action + "Page", urlParams)
  • } @@ -65,7 +65,7 @@
  • @Html.ActionLink("Page 1", action.Action, action.UrlParams)
  • @for (int i = 2; i <= action.Pages; i++) { - RouteValueDictionary urlParams = action.UrlParams; + var urlParams = action.UrlParams; urlParams["page"] = i;
  • @Html.ActionLink($"Page {i}", action.Action + "Page", urlParams)
  • }