Ported progress from SPA and began scaffolding Identity UI.
Laid some groundwork in backend. Began customizing Identity UI.
This commit is contained in:
27
Props/Services/Content/ContentManager.cs
Normal file
27
Props/Services/Content/ContentManager.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
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";
|
||||
}
|
||||
}
|
||||
}
|
7
Props/Services/Content/IContentManager.cs
Normal file
7
Props/Services/Content/IContentManager.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace Props.Services.Content
|
||||
{
|
||||
public interface IContentManager<out TModel>
|
||||
{
|
||||
dynamic Json { get; }
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user