MyBookmark/Modules.Library.Domain/Entities/MediaInfo.cs
THE_KONDRAT 7b16d72329 ui and login
mongo => postgres
2024-11-03 16:08:39 +03:00

35 lines
907 B
C#

namespace Modules.Library.Domain.Entities;
public class MediaInfo : ValueObject
{
public MediaInfoType Type { get; private set; } = MediaInfoType.OtherFile;
public string ContentType { get; private set; } = default!;
public string Url { get; private set; } = default!;
public MediaInfo(string url, MediaInfoType type, string contentType)
{
Url = url.Trim();
Type = type;
ContentType = contentType.Trim().ToLower();
}
internal void SetUrl(string value)
{
Url = value.Trim();
}
internal void SetType(MediaInfoType value)
{
Type = value;
}
internal void SetContentType(string contentType)
{
ContentType = contentType.Trim();
}
protected override IEnumerable<object?> GetEqualityComponents()
{
yield return Type;
yield return ContentType;
yield return Url;
}
}