Switched to MPA powered by Razor Pages

After reconsidering where I want to take this project, I realized that a MPA is more fitting.
This commit is contained in:
2021-07-20 19:08:57 -05:00
parent e0756e0967
commit 57f67391f1
141 changed files with 5292 additions and 22079 deletions

View File

@@ -0,0 +1,7 @@
namespace Props.Services
{
public interface IContentManager<out TModel>
{
dynamic Content { get; }
}
}

View File

@@ -0,0 +1,27 @@
using System.IO;
using Newtonsoft.Json.Linq;
namespace Props.Services
{
public class JsonContentManager<Page> : IContentManager<Page>
{
private dynamic data;
private readonly string directory;
private readonly string fileName;
dynamic IContentManager<Page>.Content
{
get
{
if (data == null) data = JValue.Parse(File.ReadAllText(Path.Combine(directory, fileName)));
return data;
}
}
public JsonContentManager(string directory = "Content")
{
this.directory = directory;
this.fileName = typeof(Page).Name.Replace("Model", "") + ".json";
}
}
}