-
Notifications
You must be signed in to change notification settings - Fork 0
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
0 parents
commit ba1972b
Showing
557 changed files
with
100,225 additions
and
0 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,2 @@ | ||
# Auto detect text files and perform LF normalization | ||
* text=auto |
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Empty file.
Binary file not shown.
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 @@ | ||
MIT License | ||
|
||
Copyright (c) 2020 Mathew Adams | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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,2 @@ | ||
# mtgdm | ||
|
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,25 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 16 | ||
VisualStudioVersion = 16.0.29806.167 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "mtgdm", "mtgdm\mtgdm.csproj", "{6A29652F-2CE6-46F6-A275-85FE97373D87}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{6A29652F-2CE6-46F6-A275-85FE97373D87}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{6A29652F-2CE6-46F6-A275-85FE97373D87}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{6A29652F-2CE6-46F6-A275-85FE97373D87}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{6A29652F-2CE6-46F6-A275-85FE97373D87}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {FE07DB07-A2BE-4F1B-B86E-0755C4AA43DC} | ||
EndGlobalSection | ||
EndGlobal |
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 @@ | ||
@{ | ||
Layout = "/Pages/Shared/_Layout.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,32 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using Microsoft.Extensions.Configuration; | ||
using Microsoft.EntityFrameworkCore; | ||
using System.Threading.Tasks; | ||
using mtgdm.Data; | ||
|
||
namespace mtgdm.ConfigurationProvider | ||
{ | ||
public class MTGDMConfigurationProvider : Microsoft.Extensions.Configuration.ConfigurationProvider | ||
{ | ||
public MTGDMConfigurationProvider(Action<DbContextOptionsBuilder> optionsAction) | ||
{ | ||
OptionsAction = optionsAction; | ||
} | ||
|
||
Action<DbContextOptionsBuilder> OptionsAction { get; } | ||
|
||
public override void Load() | ||
{ | ||
var builder = new DbContextOptionsBuilder<ApplicationDbContext>(); | ||
|
||
OptionsAction(builder); | ||
|
||
using (var dbContext = new ApplicationDbContext(builder.Options)) | ||
{ | ||
Data = dbContext.SystemValues.ToDictionary(c => c.Key, c => c.Value); | ||
} | ||
} | ||
} | ||
} |
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,22 @@ | ||
using System; | ||
using Microsoft.Extensions.Configuration; | ||
using Microsoft.EntityFrameworkCore; | ||
using mtgdm.Data; | ||
|
||
namespace mtgdm.ConfigurationProvider | ||
{ | ||
public class ConfigurationSource : IConfigurationSource | ||
{ | ||
private readonly Action<DbContextOptionsBuilder> _optionsAction; | ||
|
||
public ConfigurationSource(Action<DbContextOptionsBuilder> optionsAction) | ||
{ | ||
_optionsAction = optionsAction; | ||
} | ||
|
||
public IConfigurationProvider Build(IConfigurationBuilder builder) | ||
{ | ||
return new MTGDMConfigurationProvider(_optionsAction); | ||
} | ||
} | ||
} |
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 System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using Microsoft.EntityFrameworkCore; | ||
using Microsoft.Extensions.Configuration; | ||
using mtgdm.ConfigurationProvider; | ||
|
||
namespace mtdgm.ConfigurationProvider | ||
{ | ||
public static class EntityFrameworkExtensions | ||
{ | ||
public static IConfigurationBuilder AddEFConfiguration( | ||
this IConfigurationBuilder builder, | ||
Action<DbContextOptionsBuilder> optionsAction) | ||
{ | ||
return builder.Add(new ConfigurationSource(optionsAction)); | ||
} | ||
} | ||
} |
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 System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using Microsoft.AspNetCore.Identity.EntityFrameworkCore; | ||
using Microsoft.EntityFrameworkCore; | ||
|
||
namespace mtgdm.Data | ||
{ | ||
public class ApplicationDbContext : IdentityDbContext | ||
{ | ||
public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options) | ||
: base(options) | ||
{ | ||
} | ||
|
||
public virtual DbSet<SystemValues> SystemValues { get; set; } | ||
public virtual DbSet<Test> Test { get; set; } | ||
|
||
} | ||
} |
Oops, something went wrong.