-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
95 changed files
with
22,804 additions
and
1,118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[*] | ||
end_of_line = crlf | ||
|
||
[*.cs] | ||
dotnet_sort_system_directives_first = true | ||
dotnet_style_predefined_type_for_locals_parameters_members = true : warning | ||
dotnet_style_predefined_type_for_member_access = true : warning | ||
|
||
[*.xml] | ||
indent_style = space |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -189,3 +189,5 @@ GeneratedArtifacts/ | |
_Pvt_Extensions/ | ||
ModelManifest.xml | ||
project.lock.json | ||
.vs/ | ||
launchSettings.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,138 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio 14 | ||
VisualStudioVersion = 14.0.24720.0 | ||
# Visual Studio 15 | ||
VisualStudioVersion = 15.0.26206.0 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{A2875F06-7319-47E7-910E-02AFDB0926A8}" | ||
EndProject | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{A1A76EFD-F496-4950-9519-3121D04D6938}" | ||
EndProject | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E685C7B6-1D8A-4969-8C53-AF238F7300F8}" | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".solution", ".solution", "{68C3E5D4-06A3-4AC2-A34F-A25E9058542A}" | ||
ProjectSection(SolutionItems) = preProject | ||
global.json = global.json | ||
README.md = README.md | ||
.editorconfig = .editorconfig | ||
EndProjectSection | ||
EndProject | ||
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "FlexLabs.Util.Web", "src\FlexLabs.Util.Web\FlexLabs.Util.Web.xproj", "{819C9A3B-C8FA-42D2-9E4E-209355ED8443}" | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{353E7ED4-2A91-4875-8F64-4B0CEDA925F8}" | ||
EndProject | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{CF42A678-4FFA-47AD-AD55-5CB81D2FB15F}" | ||
EndProject | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{AC0AB6DB-8A05-4663-8816-127AA8E292A3}" | ||
EndProject | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FlexLabs.Util.Web", "src\FlexLabs.Util.Web\FlexLabs.Util.Web.csproj", "{D567670C-82E5-4FAD-8407-551E6396AE53}" | ||
EndProject | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FlexLabs.Util.Mvc", "src\FlexLabs.Util.Mvc\FlexLabs.Util.Mvc.csproj", "{67488A14-4042-41CA-86E9-9C90DD4CB354}" | ||
EndProject | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FlexLabs.Util.AspNetCore", "src\FlexLabs.Util.AspNetCore\FlexLabs.Util.AspNetCore.csproj", "{6C257350-A8F3-4D92-ACB2-E9049D247978}" | ||
EndProject | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FlexLabs.Util.AspNetCore.Sample", "samples\FlexLabs.Util.AspNetCore.Sample\FlexLabs.Util.AspNetCore.Sample.csproj", "{4CFDD24B-5EAE-40A7-B668-326EBC149761}" | ||
EndProject | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FlexLabs.Util.Mvc.Sample", "samples\FlexLabs.Util.Mvc.Sample\FlexLabs.Util.Mvc.Sample.csproj", "{0C52C87D-30EF-4247-B6B4-FD842ECA3545}" | ||
EndProject | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FlexLabs.Util.Mvc.Tests", "test\FlexLabs.Util.Mvc.Tests\FlexLabs.Util.Mvc.Tests.csproj", "{0047E4F6-42E8-4516-BAD8-121D4781C088}" | ||
EndProject | ||
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "FlexLabs.Util.Web.Tests", "test\FlexLabs.Util.Web.Tests\FlexLabs.Util.Web.Tests.xproj", "{7EA2A423-79BD-4F18-8E5C-F3681A682EF0}" | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FlexLabs.Util.Web.Tests", "test\FlexLabs.Util.Web.Tests\FlexLabs.Util.Web.Tests.csproj", "{9077AC75-2967-4B6A-81B1-E844D21D7FB4}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Debug|x64 = Debug|x64 | ||
Debug|x86 = Debug|x86 | ||
Release|Any CPU = Release|Any CPU | ||
Release|x64 = Release|x64 | ||
Release|x86 = Release|x86 | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{819C9A3B-C8FA-42D2-9E4E-209355ED8443}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{819C9A3B-C8FA-42D2-9E4E-209355ED8443}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{819C9A3B-C8FA-42D2-9E4E-209355ED8443}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{819C9A3B-C8FA-42D2-9E4E-209355ED8443}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{7EA2A423-79BD-4F18-8E5C-F3681A682EF0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{7EA2A423-79BD-4F18-8E5C-F3681A682EF0}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{7EA2A423-79BD-4F18-8E5C-F3681A682EF0}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{7EA2A423-79BD-4F18-8E5C-F3681A682EF0}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{D567670C-82E5-4FAD-8407-551E6396AE53}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{D567670C-82E5-4FAD-8407-551E6396AE53}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{D567670C-82E5-4FAD-8407-551E6396AE53}.Debug|x64.ActiveCfg = Debug|x64 | ||
{D567670C-82E5-4FAD-8407-551E6396AE53}.Debug|x64.Build.0 = Debug|x64 | ||
{D567670C-82E5-4FAD-8407-551E6396AE53}.Debug|x86.ActiveCfg = Debug|x86 | ||
{D567670C-82E5-4FAD-8407-551E6396AE53}.Debug|x86.Build.0 = Debug|x86 | ||
{D567670C-82E5-4FAD-8407-551E6396AE53}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{D567670C-82E5-4FAD-8407-551E6396AE53}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{D567670C-82E5-4FAD-8407-551E6396AE53}.Release|x64.ActiveCfg = Release|x64 | ||
{D567670C-82E5-4FAD-8407-551E6396AE53}.Release|x64.Build.0 = Release|x64 | ||
{D567670C-82E5-4FAD-8407-551E6396AE53}.Release|x86.ActiveCfg = Release|x86 | ||
{D567670C-82E5-4FAD-8407-551E6396AE53}.Release|x86.Build.0 = Release|x86 | ||
{67488A14-4042-41CA-86E9-9C90DD4CB354}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{67488A14-4042-41CA-86E9-9C90DD4CB354}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{67488A14-4042-41CA-86E9-9C90DD4CB354}.Debug|x64.ActiveCfg = Debug|x64 | ||
{67488A14-4042-41CA-86E9-9C90DD4CB354}.Debug|x64.Build.0 = Debug|x64 | ||
{67488A14-4042-41CA-86E9-9C90DD4CB354}.Debug|x86.ActiveCfg = Debug|x86 | ||
{67488A14-4042-41CA-86E9-9C90DD4CB354}.Debug|x86.Build.0 = Debug|x86 | ||
{67488A14-4042-41CA-86E9-9C90DD4CB354}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{67488A14-4042-41CA-86E9-9C90DD4CB354}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{67488A14-4042-41CA-86E9-9C90DD4CB354}.Release|x64.ActiveCfg = Release|x64 | ||
{67488A14-4042-41CA-86E9-9C90DD4CB354}.Release|x64.Build.0 = Release|x64 | ||
{67488A14-4042-41CA-86E9-9C90DD4CB354}.Release|x86.ActiveCfg = Release|x86 | ||
{67488A14-4042-41CA-86E9-9C90DD4CB354}.Release|x86.Build.0 = Release|x86 | ||
{6C257350-A8F3-4D92-ACB2-E9049D247978}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{6C257350-A8F3-4D92-ACB2-E9049D247978}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{6C257350-A8F3-4D92-ACB2-E9049D247978}.Debug|x64.ActiveCfg = Debug|x64 | ||
{6C257350-A8F3-4D92-ACB2-E9049D247978}.Debug|x64.Build.0 = Debug|x64 | ||
{6C257350-A8F3-4D92-ACB2-E9049D247978}.Debug|x86.ActiveCfg = Debug|x86 | ||
{6C257350-A8F3-4D92-ACB2-E9049D247978}.Debug|x86.Build.0 = Debug|x86 | ||
{6C257350-A8F3-4D92-ACB2-E9049D247978}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{6C257350-A8F3-4D92-ACB2-E9049D247978}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{6C257350-A8F3-4D92-ACB2-E9049D247978}.Release|x64.ActiveCfg = Release|x64 | ||
{6C257350-A8F3-4D92-ACB2-E9049D247978}.Release|x64.Build.0 = Release|x64 | ||
{6C257350-A8F3-4D92-ACB2-E9049D247978}.Release|x86.ActiveCfg = Release|x86 | ||
{6C257350-A8F3-4D92-ACB2-E9049D247978}.Release|x86.Build.0 = Release|x86 | ||
{4CFDD24B-5EAE-40A7-B668-326EBC149761}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{4CFDD24B-5EAE-40A7-B668-326EBC149761}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{4CFDD24B-5EAE-40A7-B668-326EBC149761}.Debug|x64.ActiveCfg = Debug|x64 | ||
{4CFDD24B-5EAE-40A7-B668-326EBC149761}.Debug|x64.Build.0 = Debug|x64 | ||
{4CFDD24B-5EAE-40A7-B668-326EBC149761}.Debug|x86.ActiveCfg = Debug|x86 | ||
{4CFDD24B-5EAE-40A7-B668-326EBC149761}.Debug|x86.Build.0 = Debug|x86 | ||
{4CFDD24B-5EAE-40A7-B668-326EBC149761}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{4CFDD24B-5EAE-40A7-B668-326EBC149761}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{4CFDD24B-5EAE-40A7-B668-326EBC149761}.Release|x64.ActiveCfg = Release|x64 | ||
{4CFDD24B-5EAE-40A7-B668-326EBC149761}.Release|x64.Build.0 = Release|x64 | ||
{4CFDD24B-5EAE-40A7-B668-326EBC149761}.Release|x86.ActiveCfg = Release|x86 | ||
{4CFDD24B-5EAE-40A7-B668-326EBC149761}.Release|x86.Build.0 = Release|x86 | ||
{0C52C87D-30EF-4247-B6B4-FD842ECA3545}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{0C52C87D-30EF-4247-B6B4-FD842ECA3545}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{0C52C87D-30EF-4247-B6B4-FD842ECA3545}.Debug|x64.ActiveCfg = Debug|Any CPU | ||
{0C52C87D-30EF-4247-B6B4-FD842ECA3545}.Debug|x64.Build.0 = Debug|Any CPU | ||
{0C52C87D-30EF-4247-B6B4-FD842ECA3545}.Debug|x86.ActiveCfg = Debug|Any CPU | ||
{0C52C87D-30EF-4247-B6B4-FD842ECA3545}.Debug|x86.Build.0 = Debug|Any CPU | ||
{0C52C87D-30EF-4247-B6B4-FD842ECA3545}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{0C52C87D-30EF-4247-B6B4-FD842ECA3545}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{0C52C87D-30EF-4247-B6B4-FD842ECA3545}.Release|x64.ActiveCfg = Release|Any CPU | ||
{0C52C87D-30EF-4247-B6B4-FD842ECA3545}.Release|x64.Build.0 = Release|Any CPU | ||
{0C52C87D-30EF-4247-B6B4-FD842ECA3545}.Release|x86.ActiveCfg = Release|Any CPU | ||
{0C52C87D-30EF-4247-B6B4-FD842ECA3545}.Release|x86.Build.0 = Release|Any CPU | ||
{0047E4F6-42E8-4516-BAD8-121D4781C088}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{0047E4F6-42E8-4516-BAD8-121D4781C088}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{0047E4F6-42E8-4516-BAD8-121D4781C088}.Debug|x64.ActiveCfg = Debug|x64 | ||
{0047E4F6-42E8-4516-BAD8-121D4781C088}.Debug|x64.Build.0 = Debug|x64 | ||
{0047E4F6-42E8-4516-BAD8-121D4781C088}.Debug|x86.ActiveCfg = Debug|x86 | ||
{0047E4F6-42E8-4516-BAD8-121D4781C088}.Debug|x86.Build.0 = Debug|x86 | ||
{0047E4F6-42E8-4516-BAD8-121D4781C088}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{0047E4F6-42E8-4516-BAD8-121D4781C088}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{0047E4F6-42E8-4516-BAD8-121D4781C088}.Release|x64.ActiveCfg = Release|x64 | ||
{0047E4F6-42E8-4516-BAD8-121D4781C088}.Release|x64.Build.0 = Release|x64 | ||
{0047E4F6-42E8-4516-BAD8-121D4781C088}.Release|x86.ActiveCfg = Release|x86 | ||
{0047E4F6-42E8-4516-BAD8-121D4781C088}.Release|x86.Build.0 = Release|x86 | ||
{9077AC75-2967-4B6A-81B1-E844D21D7FB4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{9077AC75-2967-4B6A-81B1-E844D21D7FB4}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{9077AC75-2967-4B6A-81B1-E844D21D7FB4}.Debug|x64.ActiveCfg = Debug|x64 | ||
{9077AC75-2967-4B6A-81B1-E844D21D7FB4}.Debug|x64.Build.0 = Debug|x64 | ||
{9077AC75-2967-4B6A-81B1-E844D21D7FB4}.Debug|x86.ActiveCfg = Debug|x86 | ||
{9077AC75-2967-4B6A-81B1-E844D21D7FB4}.Debug|x86.Build.0 = Debug|x86 | ||
{9077AC75-2967-4B6A-81B1-E844D21D7FB4}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{9077AC75-2967-4B6A-81B1-E844D21D7FB4}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{9077AC75-2967-4B6A-81B1-E844D21D7FB4}.Release|x64.ActiveCfg = Release|x64 | ||
{9077AC75-2967-4B6A-81B1-E844D21D7FB4}.Release|x64.Build.0 = Release|x64 | ||
{9077AC75-2967-4B6A-81B1-E844D21D7FB4}.Release|x86.ActiveCfg = Release|x86 | ||
{9077AC75-2967-4B6A-81B1-E844D21D7FB4}.Release|x86.Build.0 = Release|x86 | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(NestedProjects) = preSolution | ||
{819C9A3B-C8FA-42D2-9E4E-209355ED8443} = {A2875F06-7319-47E7-910E-02AFDB0926A8} | ||
{7EA2A423-79BD-4F18-8E5C-F3681A682EF0} = {A1A76EFD-F496-4950-9519-3121D04D6938} | ||
{D567670C-82E5-4FAD-8407-551E6396AE53} = {CF42A678-4FFA-47AD-AD55-5CB81D2FB15F} | ||
{67488A14-4042-41CA-86E9-9C90DD4CB354} = {CF42A678-4FFA-47AD-AD55-5CB81D2FB15F} | ||
{6C257350-A8F3-4D92-ACB2-E9049D247978} = {CF42A678-4FFA-47AD-AD55-5CB81D2FB15F} | ||
{4CFDD24B-5EAE-40A7-B668-326EBC149761} = {353E7ED4-2A91-4875-8F64-4B0CEDA925F8} | ||
{0C52C87D-30EF-4247-B6B4-FD842ECA3545} = {353E7ED4-2A91-4875-8F64-4B0CEDA925F8} | ||
{0047E4F6-42E8-4516-BAD8-121D4781C088} = {AC0AB6DB-8A05-4663-8816-127AA8E292A3} | ||
{9077AC75-2967-4B6A-81B1-E844D21D7FB4} = {AC0AB6DB-8A05-4663-8816-127AA8E292A3} | ||
EndGlobalSection | ||
EndGlobal |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"directory": "wwwroot/lib" | ||
} |
34 changes: 34 additions & 0 deletions
34
samples/FlexLabs.Util.AspNetCore.Sample/Controllers/HomeController.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using FlexLabs.Linq; | ||
using FlexLabs.Util.AspNetCore.Sample.Models; | ||
using FlexLabs.Util.AspNetCore.Sample.ViewModels.Home; | ||
using Microsoft.AspNetCore.Mvc; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
namespace FlexLabs.Util.AspNetCore.Sample.Controllers | ||
{ | ||
public class HomeController : Controller | ||
{ | ||
private readonly static OrderByExpressionCollection<UserSorter, User> _userSorter = new OrderByExpressionCollection<UserSorter, User> | ||
{ | ||
{ UserSorter.ID, u => u.ID }, | ||
{ UserSorter.Name, u => u.Name }, | ||
}; | ||
IEnumerable<User> GetUsersFromDatabase(UserSorter sortBy, bool sortAsc) | ||
=> Enumerable.Range(1, 10_000) | ||
.Select(i => new User | ||
{ | ||
ID = i, | ||
Name = $"User {i}", | ||
}) | ||
.AsQueryable() | ||
.OrderBy(_userSorter, sortBy, sortAsc); | ||
|
||
public IActionResult Index(IndexModel model) | ||
{ | ||
var allSortedUsers = GetUsersFromDatabase(model.GetSortBy(), model.GetSortAsc()); | ||
model.SetPageItems(allSortedUsers); | ||
return View(model); | ||
} | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
samples/FlexLabs.Util.AspNetCore.Sample/FlexLabs.Util.AspNetCore.Sample.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.Web"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net46</TargetFramework> | ||
<RuntimeIdentifier>win7-x86</RuntimeIdentifier> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<PackageReference Include="FlexLabs.Util" Version="1.2.0" /> | ||
<PackageReference Include="Microsoft.AspNetCore" Version="1.1.0" /> | ||
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.1" /> | ||
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.1.0" /> | ||
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.1.0" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="1.0.0-msbuild3-final" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\..\src\FlexLabs.Util.AspNetCore\FlexLabs.Util.AspNetCore.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace FlexLabs.Util.AspNetCore.Sample.Models | ||
{ | ||
public class User | ||
{ | ||
public int ID { get; set; } | ||
public string Name { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace FlexLabs.Util.AspNetCore.Sample.Models | ||
{ | ||
public enum UserSorter | ||
{ | ||
ID, | ||
Name, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using Microsoft.AspNetCore.Hosting; | ||
using System.IO; | ||
|
||
namespace FlexLabs.Util.AspNetCore.Sample | ||
{ | ||
public class Program | ||
{ | ||
public static void Main(string[] args) | ||
{ | ||
var host = new WebHostBuilder() | ||
.UseKestrel() | ||
.UseContentRoot(Directory.GetCurrentDirectory()) | ||
.UseIISIntegration() | ||
.UseStartup<Startup>() | ||
.Build(); | ||
|
||
host.Run(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
using Microsoft.AspNetCore.Builder; | ||
using Microsoft.AspNetCore.Hosting; | ||
using Microsoft.Extensions.Configuration; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using Microsoft.Extensions.Logging; | ||
|
||
namespace FlexLabs.Util.AspNetCore.Sample | ||
{ | ||
public class Startup | ||
{ | ||
public Startup(IHostingEnvironment env) | ||
{ | ||
var builder = new ConfigurationBuilder() | ||
.SetBasePath(env.ContentRootPath) | ||
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true) | ||
.AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true) | ||
.AddEnvironmentVariables(); | ||
Configuration = builder.Build(); | ||
} | ||
|
||
public IConfigurationRoot Configuration { get; } | ||
|
||
// This method gets called by the runtime. Use this method to add services to the container. | ||
public void ConfigureServices(IServiceCollection services) | ||
{ | ||
// Add framework services. | ||
services.AddMvc(); | ||
} | ||
|
||
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. | ||
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) | ||
{ | ||
loggerFactory.AddConsole(Configuration.GetSection("Logging")); | ||
loggerFactory.AddDebug(); | ||
|
||
if (env.IsDevelopment()) | ||
{ | ||
app.UseDeveloperExceptionPage(); | ||
|
||
// Browser Link is not compatible with Kestrel 1.1.0 | ||
// For details on enabling Browser Link, see https://go.microsoft.com/fwlink/?linkid=840936 | ||
// app.UseBrowserLink(); | ||
} | ||
else | ||
{ | ||
app.UseExceptionHandler("/Home/Error"); | ||
} | ||
|
||
app.UseStaticFiles(); | ||
|
||
app.UseMvc(routes => | ||
{ | ||
routes.MapRoute( | ||
name: "default", | ||
template: "{controller=Home}/{action=Index}/{id?}"); | ||
}); | ||
} | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
samples/FlexLabs.Util.AspNetCore.Sample/ViewModels/Home/IndexModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using FlexLabs.Util.AspNetCore.Sample.Models; | ||
using FlexLabs.Web; | ||
|
||
namespace FlexLabs.Util.AspNetCore.Sample.ViewModels.Home | ||
{ | ||
public class IndexModel : TableModel<UserSorter, User> | ||
{ | ||
public IndexModel() | ||
: base(UserSorter.ID, true) | ||
{ } | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
samples/FlexLabs.Util.AspNetCore.Sample/Views/Home/Index.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
@using FlexLabs.Util.AspNetCore.Sample.Models | ||
@model FlexLabs.Util.AspNetCore.Sample.ViewModels.Home.IndexModel | ||
@{ | ||
ViewData["Title"] = "Home Page"; | ||
} | ||
|
||
<form fl-sortable method="post"> | ||
<table class="sortable"> | ||
<thead> | ||
<tr> | ||
<th fl-sortby="UserSorter.ID">ID</th> | ||
<th fl-sortby="UserSorter.Name">Name</th> | ||
</tr> | ||
</thead> | ||
@foreach (var user in Model.PageItems) | ||
{ | ||
<tr> | ||
<td>@user.ID</td> | ||
<td>@user.Name</td> | ||
</tr> | ||
} | ||
</table> | ||
<div> | ||
<div class="half-width">Page Size: <fl-pagesizer /></div> | ||
<div class="half-width content-right">Page: <fl-pager class="pager" /></div> | ||
</div> | ||
</form> |
Oops, something went wrong.