35 lines
942 B
C#
35 lines
942 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 ObjectId { get; private set; } = default!;
|
|
|
|
public MediaInfo(string objectId, MediaInfoType type, string contentType)
|
|
{
|
|
ObjectId = objectId.Trim();
|
|
Type = type;
|
|
ContentType = contentType.Trim().ToLower();
|
|
}
|
|
|
|
internal void SetObjectId(string value)
|
|
{
|
|
ObjectId = 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 ObjectId;
|
|
}
|
|
} |