2024-09-25 22:11:28 +02:00
|
|
|
using System.Text.Json.Serialization;
|
|
|
|
|
|
|
|
|
|
namespace WatchIt.Common.Model;
|
|
|
|
|
|
2024-10-03 21:05:04 +02:00
|
|
|
public class Picture
|
2024-09-25 22:11:28 +02:00
|
|
|
{
|
|
|
|
|
#region PROPERTIES
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("image")]
|
|
|
|
|
public required byte[] Image { get; set; }
|
|
|
|
|
|
|
|
|
|
[JsonPropertyName("mime_type")]
|
|
|
|
|
public required string MimeType { get; set; }
|
|
|
|
|
|
|
|
|
|
#endregion
|
2024-09-27 01:05:06 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region PUBLIC METHODS
|
|
|
|
|
|
|
|
|
|
public override string ToString() => $"data:{MimeType};base64,{Convert.ToBase64String(Image)}";
|
|
|
|
|
|
|
|
|
|
#endregion
|
2024-09-25 22:11:28 +02:00
|
|
|
}
|