props/Props/Services/Content/ContentManager.cs
Harrison Deng b43d7bab84 Ported progress from SPA and began scaffolding Identity UI.
Laid some groundwork in backend.

Began customizing Identity UI.
2021-07-24 00:03:32 -05:00

27 lines
715 B
C#

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