-
-
Notifications
You must be signed in to change notification settings - Fork 243
Expand file tree
/
Copy pathMovies.cs
More file actions
36 lines (30 loc) · 925 Bytes
/
Movies.cs
File metadata and controls
36 lines (30 loc) · 925 Bytes
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
using System.Collections.Generic;
namespace CodeFirst.DataAccess.Models;
public class Movies
{
public int MovieId { get; set; }
public string Title { get; set; }
public int Year { get; set; }
public int AgeRestriction { get; set; }
public float Price { get; set; }
public Movies()
{
}
public Movies(int movieId, string title, int year, int ageRestriction, float price)
{
MovieId = movieId;
Title = title;
Year = year;
AgeRestriction = ageRestriction;
Price = price;
}
// navigational properties
// one movie may have many copies
public virtual ICollection<Copies> Copies { get; set; }
// this is composite key to get many to many movies - actors
public virtual ICollection<Starring> Starring { get; set; }
public override string ToString()
{
return $"{MovieId}, {Title}, {Year}, {Price}";
}
}