mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
refactor: method extraction
This commit is contained in:
parent
49804823a6
commit
4182365203
1 changed files with 8 additions and 3 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue