project reorganized

This commit is contained in:
2024-04-27 22:36:16 +02:00
Unverified
parent fcca2119a5
commit 4b333878b8
233 changed files with 4916 additions and 11471 deletions

View File

@@ -0,0 +1,12 @@
[
{
"Id": 1,
"Name": "Afghanistan",
"IsHistorical": false
},
{
"Id": 2,
"Name": "Albania",
"IsHistorical": false
}
]

View File

@@ -0,0 +1,10 @@
[
{
"Id": 1,
"Name": "Male"
},
{
"Id": 2,
"Name": "Female"
}
]

View File

@@ -0,0 +1,22 @@
[
{
"Id": 1,
"Name": "Comedy"
},
{
"Id": 2,
"Name": "Thriller"
},
{
"Id": 3,
"Name": "Horror"
},
{
"Id": 4,
"Name": "Action"
},
{
"Id": 5,
"Name": "Drama"
}
]

View File

@@ -0,0 +1,14 @@
[
{
"Id": 1,
"Name": "Actor"
},
{
"Id": 2,
"Name": "Supporting actor"
},
{
"Id": 3,
"Name": "Voice actor"
}
]

View File

@@ -0,0 +1,14 @@
[
{
"Id": 1,
"Name": "Director"
},
{
"Id": 2,
"Name": "Producer"
},
{
"Id": 3,
"Name": "Screenwriter"
}
]

View File

@@ -0,0 +1,23 @@
using System.Text.Json;
namespace WatchIt.Database.Model.Seeding;
public class DataReader
{
#region METHODS
public static IEnumerable<T> Read<T>() => Read<T>(typeof(T).Name);
public static IEnumerable<T> Read<T>(string filename)
{
string jsonFile = $@"..\..\WatchIt.Database\WatchIt.Database.Model\WatchIt.Database.Model.Seeding\Data\{filename}.json";
string dataString = File.ReadAllText(jsonFile);
IEnumerable<T>? data = JsonSerializer.Deserialize<IEnumerable<T>>(dataString);
if (data is null)
{
throw new JsonException();
}
return data;
}
#endregion
}

View File

@@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>