-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathModel.cs
82 lines (77 loc) · 2.55 KB
/
Model.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
using System;
using System.ComponentModel.DataAnnotations;
using Microsoft.EntityFrameworkCore;
namespace MoviesManagementSystem
{
// <summary>
/// Represents the database context for the Movies Management System.
/// </summary>
public class MoviesDataContext : DbContext
{
public DbSet<Person> person { get; set; }
public DbSet<Episode> episode { get; set; }
public DbSet<Title> title { get; set; }
public DbSet<Principals> principals { get; set; }
public DbSet<Crew> crew { get; set; }
public DbSet<Ratings> ratings { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseMySql(Connection.connectionString, ServerVersion.AutoDetect(Connection.connectionString));
}
}
public class Person
{
[Key]
public string nconst { get; set; }
public string primaryName { get; set; }
public string birthYear { get; set; }
public string deathYear { get; set; }
public string primaryProfession { get; set; }
public string knownForTitles { get; set; }
}
public class Title
{
[Key]
public string tconst { get; set; }
public string titleType { get; set; }
public string primaryTitle { get; set; }
public string originalTitle { get; set; }
public string isAdult { get; set; }
public string startYear { get; set; }
public string endYear { get; set; }
public string runtimeMinutes { get; set; }
public string genres { get; set; }
}
public class Episode
{
[Key]
public string tconst { get; set; }
public string parentTconst { get; set; }
public string seasonNumber { get; set; }
public string episodeNumber { get; set; }
}
[PrimaryKey(nameof(tconst), nameof(nconst))]
public class Principals
{
public string tconst { get; set; }
public string ordering { get; set; }
public string nconst { get; set; }
public string category { get; set; }
public string job { get; set; }
public string characters { get; set; }
}
public class Crew
{
[Key]
public string tconst { get; set; }
public string directors { get; set; }
public string writers { get; set; }
}
public class Ratings
{
[Key]
public string tconst { get; set; }
public string averageRating { get; set; }
public string numVotes { get; set; }
}
}