refactor: method extraction

This commit is contained in:
Collin M. Barrett 2017-10-25 13:12:54 -05:00
parent 49804823a6
commit 4182365203

View file

@ -8,6 +8,13 @@ namespace FilterLists.Data.Json
public static class JsonSampleGenerator
{
public static void WriteSampleToFile()
{
File.WriteAllText(
Path.GetFullPath(Path.Combine(AppContext.BaseDirectory + @"\", @"..\..\..\..\..\data\")) +
"ListSample.json", GetSampleList().ToString());
}
private static JObject GetSampleList()
{
var sampleList = (JObject) JToken.FromObject(new List
{
@ -25,9 +32,7 @@ public static void WriteSampleToFile()
sampleList.Remove("Id");
sampleList.Remove("AddedDateUtc");
sampleList.Remove("ModifiedDateUtc");
File.WriteAllText(
Path.GetFullPath(Path.Combine(AppContext.BaseDirectory + @"\", @"..\..\..\..\..\data\")) +
"ListSample.json", sampleList.ToString());
return sampleList;
}
}
}