move project
This commit is contained in:
13
db/models/Setting.cs
Normal file
13
db/models/Setting.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
namespace Db.Models;
|
||||
|
||||
public class Setting
|
||||
{
|
||||
public required SettingName Name { get; set; }
|
||||
public required string Value { get; set; }
|
||||
|
||||
// methods to convert Value to specific types that are not connected to entity framework
|
||||
public T GetValue<T>()
|
||||
{
|
||||
return (T)Convert.ChangeType(Value, typeof(T));
|
||||
}
|
||||
}
|
10
db/models/Tag.cs
Normal file
10
db/models/Tag.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace Db.Models;
|
||||
|
||||
public class Tag
|
||||
{
|
||||
// We use the name of the tag as the Id to ensure uniqueness
|
||||
public required string Name { get; set; }
|
||||
|
||||
|
||||
public ICollection<VideoTag> VideoTags { get; set; } = [];
|
||||
}
|
19
db/models/Video.cs
Normal file
19
db/models/Video.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
namespace Db.Models;
|
||||
|
||||
public class Video
|
||||
{
|
||||
// Disable warning as Id is required but not set in the constructor.
|
||||
// This is to ensure that the Id is set by the database when the entity is added
|
||||
#pragma warning disable CS8618
|
||||
public string Id { get; set; }
|
||||
#pragma warning restore CS8618
|
||||
|
||||
public string? Title { get; set; }
|
||||
public TimeSpan Duration { get; set; }
|
||||
public int Width { get; set; }
|
||||
public int Height { get; set; }
|
||||
public string Extension { get; set; } = string.Empty; // File extension of the video file
|
||||
|
||||
|
||||
public ICollection<VideoTag> VideoTags { get; set; } = [];
|
||||
}
|
10
db/models/VideoTag.cs
Normal file
10
db/models/VideoTag.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace Db.Models;
|
||||
|
||||
public class VideoTag
|
||||
{
|
||||
public string VideoId { get; set; }
|
||||
public Video Video { get; set; }
|
||||
|
||||
public string TagId { get; set; }
|
||||
public Tag Tag { get; set; }
|
||||
}
|
Reference in New Issue
Block a user