Created
April 15, 2024 13:42
-
-
Save adamstirtan/e0e8a8fb9544eba6112d98551d1e23bb to your computer and use it in GitHub Desktop.
A hierarchy of objects to be serialized into JSON in a single array
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class StreamItemDTO | |
| { | |
| public required long Id { get; set; } | |
| public required string Type { get; set; } | |
| public long? MediaId { get; set; } | |
| public required string Title { get; set; } | |
| public required string Description { get; set; } | |
| public required DateTime Timestamp { get; set; } | |
| } | |
| public class EventStreamItemDTO : StreamItemDTO | |
| { | |
| public required long EventTypeId { get; set; } | |
| public required string EventType { get; set; } | |
| public required DateTime EventDate { get; set; } | |
| public string MediaUrl { get; set; } = string.Empty; | |
| public string MediaPreviewUrl { get; set; } = string.Empty; | |
| public string MediaThumbnailUrl { get; set; } = string.Empty; | |
| } | |
| public class NewsStreamItemDTO : StreamItemDTO | |
| { | |
| public string MediaUrl { get; set; } = string.Empty; | |
| public string MediaPreviewUrl { get; set; } = string.Empty; | |
| public string MediaThumbnailUrl { get; set; } = string.Empty; | |
| } | |
| public class PhotoStreamItemDTO : StreamItemDTO | |
| { | |
| public required int Likes { get; set; } | |
| public required int Comments { get; set; } | |
| public required string MediaUrl { get; set; } | |
| public required string MediaPreviewUrl { get; set; } | |
| public required string MediaThumbnailUrl { get; set; } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment