aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAryadev Chavali <aryadevchavali1@gmail.com>2019-02-04 12:19:19 +0000
committerAryadev Chavali <aryadevchavali1@gmail.com>2019-02-04 12:19:19 +0000
commit4e729d1b0a9ca65eaaa8f95eeba216abc68c2447 (patch)
treef7a28c38705d7b948d19d0c10511ed2f85153b1a
parent381c875f8e24c4b91f88820b8ab730d4eea18af1 (diff)
downloadnewsaggregator-4e729d1b0a9ca65eaaa8f95eeba216abc68c2447.tar.gz
newsaggregator-4e729d1b0a9ca65eaaa8f95eeba216abc68c2447.tar.bz2
newsaggregator-4e729d1b0a9ca65eaaa8f95eeba216abc68c2447.zip
Made a function to get details from details.json
-rw-r--r--Database/DetailsHelper.cs14
1 files changed, 14 insertions, 0 deletions
diff --git a/Database/DetailsHelper.cs b/Database/DetailsHelper.cs
new file mode 100644
index 0000000..4053594
--- /dev/null
+++ b/Database/DetailsHelper.cs
@@ -0,0 +1,14 @@
+using System.IO;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+using Newtonsoft.Json;
+
+namespace Database {
+ public static class DetailsHelper {
+ public static async Task<Dictionary<string, string>> GetDetails() {
+ string json = string.Join('\n', await File.ReadAllLinesAsync("details.json"));
+ return JsonConvert.DeserializeObject<Dictionary<string, string>>(json);
+ }
+ }
+} \ No newline at end of file