Separate ViewModels into separate library, convert Model library into .NET Standard library

This commit is contained in:
BuildFeed Bot 2018-04-28 09:11:07 +01:00
parent e7939dea1d
commit d0880113f6
No known key found for this signature in database
GPG Key ID: 3757685ADD91E0A1
33 changed files with 259 additions and 287 deletions

View File

@ -11,7 +11,6 @@
namespace BuildFeed.Model
{
[DataObject]
[BsonIgnoreExtraElements]
public class Build : BuildDetails
{
@ -155,27 +154,27 @@ private void GenerateLabUrl()
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;
}

View File

@ -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 @@ public class BuildDetails
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))]

View File

@ -1,118 +1,19 @@
<?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')" />
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{7E2B4F61-1C11-4471-AF80-5480E94C0664}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>BuildFeed.Model</RootNamespace>
<AssemblyName>BuildFeed.Model</AssemblyName>
<TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
</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>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AutoMapper">
<Version>6.2.2</Version>
</PackageReference>
<PackageReference Include="HtmlAgilityPack">
<Version>1.8.1</Version>
</PackageReference>
<PackageReference Include="Microsoft.AspNet.Mvc">
<Version>5.2.4</Version>
</PackageReference>
<PackageReference Include="Microsoft.AspNet.Razor">
<Version>3.2.4</Version>
</PackageReference>
<PackageReference Include="Microsoft.AspNet.WebPages">
<Version>3.2.4</Version>
</PackageReference>
<PackageReference Include="MongoDB.Driver">
<Version>2.6.0</Version>
</PackageReference>
<PackageReference Include="AutoMapper" Version="6.2.2" />
<PackageReference Include="HtmlAgilityPack" Version="1.8.1" />
<PackageReference Include="MongoDB.Driver" Version="2.6.0" />
<PackageReference Include="System.ComponentModel.Annotations" Version="4.4.1" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.4.1" />
</ItemGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Web" />
<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" />
<ProjectReference Include="..\BuildFeed.Local\BuildFeed.Local.csproj" />
</ItemGroup>
<ItemGroup>
<Compile Include="Api\ApiBuild.cs" />
<Compile Include="Api\FamilyOverview.cs" />
<Compile Include="Api\NewBuild.cs" />
<Compile Include="Api\SearchResult.cs" />
<Compile Include="BuildDetails.cs" />
<Compile Include="BuildRepository-Group.cs" />
<Compile Include="BuildRepository-Lab.cs" />
<Compile Include="BuildRepository-Family.cs" />
<Compile Include="BuildRepository-Source.cs" />
<Compile Include="BuildRepository-Version.cs" />
<Compile Include="BuildRepository-Year.cs" />
<Compile Include="BuildRepository.cs" />
<Compile Include="BuildGroup.cs" />
<Compile Include="Build.cs" />
<Compile Include="BuildVersion.cs" />
<Compile Include="ItemHistory.cs" />
<Compile Include="ItemHistoryType.cs" />
<Compile Include="MetaItem.cs" />
<Compile Include="ModelMappings.cs" />
<Compile Include="MongoConfig.cs" />
<Compile Include="ProjectFamily.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TypeOfSource.cs" />
<Compile Include="View\AddBulk.cs" />
<Compile Include="View\ChangePassword.cs" />
<Compile Include="View\FrontBuildGroup.cs" />
<Compile Include="View\FrontPage.cs" />
<Compile Include="View\LoginUser.cs" />
<Compile Include="View\RegistrationUser.cs" />
<Compile Include="View\SitemapData.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\BuildFeed.Local\BuildFeed.Local.csproj">
<Project>{9ebd4db1-1d37-456b-ad90-357aa89dd1b7}</Project>
<Name>BuildFeed.Local</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- 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>

View File

@ -4,7 +4,6 @@
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 @@
namespace BuildFeed.Model
{
[DataObject]
public class MetaItemModel
{
[Key]
@ -24,7 +22,7 @@ public class MetaItemModel
public string MetaDescription { get; set; }
[DisplayName("Page Content")]
[AllowHtml]
//[AllowHtml]
public string PageContent { get; set; }
}
@ -55,24 +53,21 @@ public MetaItem()
_bModel = new BuildRepository();
}
[DataObjectMethod(DataObjectMethodType.Select, false)]
public async Task<IEnumerable<MetaItemModel>> Select()
=> await _metaCollection.Find(new BsonDocument()).ToListAsync();
[DataObjectMethod(DataObjectMethodType.Select, true)]
public async Task<IEnumerable<MetaItemModel>> SelectByType(MetaType type)
{
return await _metaCollection.Find(f => f.Id.Type == type).ToListAsync();
}
[DataObjectMethod(DataObjectMethodType.Select, false)]
public async Task<MetaItemModel> 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<IEnumerable<string>> SelectUnusedLabs()
{
var labs = await _bModel.SelectAllLabs();
@ -84,7 +79,6 @@ where usedLabs.All(ul => ul.Id.Value != l)
select l;
}
[DataObjectMethod(DataObjectMethodType.Select, false)]
public async Task<IEnumerable<string>> SelectUnusedVersions()
{
var versions = await _bModel.SelectAllVersions();
@ -96,7 +90,6 @@ where usedVersions.All(ul => ul.Id.Value != v.ToString())
select v.ToString();
}
[DataObjectMethod(DataObjectMethodType.Select, false)]
public async Task<IEnumerable<string>> SelectUnusedYears()
{
var years = await _bModel.SelectAllYears();
@ -108,7 +101,6 @@ where usedYears.All(ul => ul.Id.Value != y.ToString())
select y.ToString();
}
[DataObjectMethod(DataObjectMethodType.Select, false)]
public async Task<IEnumerable<string>> SelectUnusedFamilies()
{
var families = await _bModel.SelectAllFamilies();
@ -120,25 +112,21 @@ where usedFamilies.All(ul => ul.Id.Value != y.ToString())
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<MetaItemModel> 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);

View File

@ -1,38 +0,0 @@
using System;
using System.Collections.Generic;
using System.Web.Routing;
namespace BuildFeed.Model.View
{
public class SitemapData
{
public Dictionary<string, SitemapPagedAction[]> 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; }
}
}

View File

@ -1,18 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Runtime.InteropServices.RuntimeInformation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.1"/>
</startup>
</configuration>

View File

@ -1,4 +1,4 @@
namespace BuildFeed.Model.View
namespace BuildFeed.ViewModel
{
public class BulkAddition
{

View File

@ -0,0 +1,68 @@
<?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>{F70F4167-DB65-4DDB-94ED-1B9419D520A3}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>BuildFeed.ViewModel</RootNamespace>
<AssemblyName>BuildFeed.ViewModel</AssemblyName>
<TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</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="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="AddBulk.cs" />
<Compile Include="ChangePassword.cs" />
<Compile Include="FrontBuildGroup.cs" />
<Compile Include="FrontPage.cs" />
<Compile Include="FrontPageBuild.cs" />
<Compile Include="LoginUser.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="RegistrationUser.cs" />
<Compile Include="SitemapData.cs" />
<Compile Include="SitemapDataBuild.cs" />
<Compile Include="SitemapDataBuildGroup.cs" />
<Compile Include="SitemapPagedAction.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\BuildFeed.Local\BuildFeed.Local.csproj">
<Project>{9ebd4db1-1d37-456b-ad90-357aa89dd1b7}</Project>
<Name>BuildFeed.Local</Name>
</ProjectReference>
<ProjectReference Include="..\BuildFeed.Model\BuildFeed.Model.csproj">
<Project>{294e58eb-a6c6-4cad-b9f8-b70fc004037f}</Project>
<Name>BuildFeed.Model</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@ -1,7 +1,7 @@
using System.ComponentModel.DataAnnotations;
using BuildFeed.Local;
namespace BuildFeed.Model.View
namespace BuildFeed.ViewModel
{
public class ChangePassword
{

View File

@ -1,6 +1,7 @@
using System;
using BuildFeed.Model;
namespace BuildFeed.Model.View
namespace BuildFeed.ViewModel
{
public class FrontBuildGroup
{

View File

@ -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; }
}
}

View File

@ -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]

View File

@ -1,7 +1,7 @@
using System.ComponentModel.DataAnnotations;
using BuildFeed.Local;
namespace BuildFeed.Model.View
namespace BuildFeed.ViewModel
{
public class LoginUser
{

View File

@ -1,28 +1,26 @@
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("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
// 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:
//
@ -34,6 +32,5 @@
// 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")]

View File

@ -1,7 +1,7 @@
using System.ComponentModel.DataAnnotations;
using BuildFeed.Local;
namespace BuildFeed.Model.View
namespace BuildFeed.ViewModel
{
public class RegistrationUser
{

View File

@ -0,0 +1,12 @@
using System.Collections.Generic;
namespace BuildFeed.ViewModel
{
public class SitemapData
{
public Dictionary<string, SitemapPagedAction[]> Actions { get; set; }
public SitemapDataBuildGroup[] Builds { get; set; }
public string[] Labs { get; set; }
}
}

View File

@ -0,0 +1,10 @@
using System;
namespace BuildFeed.ViewModel
{
public class SitemapDataBuild
{
public Guid Id { get; set; }
public string Name { get; set; }
}
}

View File

@ -0,0 +1,10 @@
using BuildFeed.Model;
namespace BuildFeed.ViewModel
{
public class SitemapDataBuildGroup
{
public SitemapDataBuild[] Builds { get; set; }
public BuildGroup Id { get; set; }
}
}

View File

@ -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<string, object> UrlParams { get; set; }
}
}

View File

@ -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

View File

@ -1,4 +1,4 @@
@using BuildFeed.Model.View
@using BuildFeed.ViewModel
@helper LatestBuild(string title, FrontPageBuild build)
{
<h4 class="latest-flex-title">@title</h4>

View File

@ -96,6 +96,9 @@
<PackageReference Include="MSBuildGitHash">
<Version>0.3.0</Version>
</PackageReference>
<PackageReference Include="NETStandard.Library">
<Version>2.0.2</Version>
</PackageReference>
<PackageReference Include="OneSignal.RestAPIv3.Client">
<Version>1.0.3</Version>
</PackageReference>
@ -104,6 +107,9 @@
</PackageReference>
</ItemGroup>
<ItemGroup>
<Reference Include="netstandard">
<Private>true</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.Data" />
@ -371,9 +377,13 @@
<Name>BuildFeed.Local</Name>
</ProjectReference>
<ProjectReference Include="..\BuildFeed.Model\BuildFeed.Model.csproj">
<Project>{7e2b4f61-1c11-4471-af80-5480e94c0664}</Project>
<Project>{294e58eb-a6c6-4cad-b9f8-b70fc004037f}</Project>
<Name>BuildFeed.Model</Name>
</ProjectReference>
<ProjectReference Include="..\BuildFeed.ViewModel\BuildFeed.ViewModel.csproj">
<Project>{f70f4167-db65-4ddb-94ed-1b9419d520a3}</Project>
<Name>BuildFeed.ViewModel</Name>
</ProjectReference>
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>

View File

@ -5,7 +5,7 @@
using System.Web.Security;
using BuildFeed.Code;
using BuildFeed.Local;
using BuildFeed.Model.View;
using BuildFeed.ViewModel;
using MongoAuth;
namespace BuildFeed.Controllers

View File

@ -10,7 +10,7 @@
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

View File

@ -13,7 +13,7 @@
using System.Web.Mvc;
using BuildFeed.Code;
using BuildFeed.Model;
using BuildFeed.Model.View;
using BuildFeed.ViewModel;
using OneSignal.RestAPIv3.Client;
namespace BuildFeed.Controllers

View File

@ -8,7 +8,7 @@
using BuildFeed.Code;
using BuildFeed.Local;
using BuildFeed.Model;
using BuildFeed.Model.View;
using BuildFeed.ViewModel;
namespace BuildFeed.Controllers
{
@ -42,12 +42,12 @@ public async Task<ActionResult> Sitemap()
{
new SitemapPagedAction
{
UrlParams = new RouteValueDictionary(new
UrlParams = new Dictionary<string, object>
{
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 @@ into bv
select new SitemapPagedAction
{
Name = $"{InvariantTerms.ProductName} {bv.Key.Major}.{bv.Key.Minor}",
UrlParams = new RouteValueDictionary(new
UrlParams = new Dictionary<string, object>
{
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 @@ orderby bv.Key
select new SitemapPagedAction
{
Name = bv.Key,
UrlParams = new RouteValueDictionary(new
UrlParams = new Dictionary<string, object>
{
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 @@ orderby bv.Key descending
select new SitemapPagedAction
{
Name = bv.Key.ToString(),
UrlParams = new RouteValueDictionary(new
UrlParams = new Dictionary<string, object>
{
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 @@ orderby bv.Key
select new SitemapPagedAction
{
Name = MvcExtensions.GetDisplayTextForEnum(bv.Key),
UrlParams = new RouteValueDictionary(new
UrlParams = new Dictionary<string, object>
{
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()
}

View File

@ -1,5 +1,5 @@
@using BuildFeed.Controllers
@using BuildFeed.Model.View
@using BuildFeed.ViewModel
@model LoginUser
@{

View File

@ -1,4 +1,4 @@
@using BuildFeed.Model.View
@using BuildFeed.ViewModel
@model ChangePassword
@{

View File

@ -1,4 +1,4 @@
@using BuildFeed.Model.View
@using BuildFeed.ViewModel
@model RegistrationUser
@{

View File

@ -1,6 +1,6 @@
@using BuildFeed.Controllers
@using BuildFeed.Model
@using BuildFeed.Model.View
@using BuildFeed.ViewModel
@model BulkAddition
@{

View File

@ -1,6 +1,6 @@
@using BuildFeed.Code
@using BuildFeed.Controllers
@using BuildFeed.Model.View
@using BuildFeed.ViewModel
@using Humanizer
@model IEnumerable<FrontBuildGroup>
@{

View File

@ -1,7 +1,7 @@
@using BuildFeed.Code
@using BuildFeed.Controllers
@using BuildFeed.Model
@using BuildFeed.Model.View
@using BuildFeed.ViewModel
@model Dictionary<ProjectFamily, FrontPage>
@{
ViewBag.Title = string.Format(VariantTerms.Front_HomeH1, InvariantTerms.SiteName);

View File

@ -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 @@
<li>@Html.ActionLink("Page 1", action.Action, action.UrlParams)</li>
for (int i = 2; i <= action.Pages; i++)
{
RouteValueDictionary urlParams = action.UrlParams;
var urlParams = action.UrlParams;
urlParams["page"] = i;
<li>@Html.ActionLink($"Page {i}", action.Action + "Page", urlParams)</li>
}
@ -65,7 +65,7 @@
<li>@Html.ActionLink("Page 1", action.Action, action.UrlParams)</li>
@for (int i = 2; i <= action.Pages; i++)
{
RouteValueDictionary urlParams = action.UrlParams;
var urlParams = action.UrlParams;
urlParams["page"] = i;
<li>@Html.ActionLink($"Page {i}", action.Action + "Page", urlParams)</li>
}