| | 1 | | namespace Songhay.Models; |
| | 2 | |
|
| | 3 | | /// <summary> |
| | 4 | | /// Model for display item. |
| | 5 | | /// </summary> |
| | 6 | | /// <remarks> |
| | 7 | | /// This class was originally developed |
| | 8 | | /// to compensate for RIA Services not supporting composition |
| | 9 | | /// of Entity Framework entities |
| | 10 | | /// where an Entity is the property of another object. |
| | 11 | | /// </remarks> |
| | 12 | | public class DisplayItemModel : ISortable, ITemporal |
| | 13 | | { |
| | 14 | | /// <summary> |
| | 15 | | /// Gets or sets the description. |
| | 16 | | /// </summary> |
| 0 | 17 | | public string? Description { get; set; } |
| | 18 | |
|
| | 19 | | /// <summary> |
| | 20 | | /// Gets or sets the display text. |
| | 21 | | /// </summary> |
| 0 | 22 | | public string? DisplayText { get; set; } |
| | 23 | |
|
| | 24 | | /// <summary> |
| | 25 | | /// Gets or sets the identifier. |
| | 26 | | /// </summary> |
| 0 | 27 | | public int Id { get; set; } |
| | 28 | |
|
| | 29 | | /// <summary> |
| | 30 | | /// Gets or sets the item name. |
| | 31 | | /// </summary> |
| 0 | 32 | | public string? ItemName { get; set; } |
| | 33 | |
|
| | 34 | | /// <summary> |
| | 35 | | /// Gets or sets the resource indicator. |
| | 36 | | /// </summary> |
| 0 | 37 | | public Uri? ResourceIndicator { get; set; } |
| | 38 | |
|
| | 39 | | /// <summary> |
| | 40 | | /// Gets or sets the tag. |
| | 41 | | /// </summary> |
| 0 | 42 | | public object? Tag { get; set; } |
| | 43 | |
|
| | 44 | | #region ISortable members: |
| | 45 | |
|
| | 46 | | /// <summary> |
| | 47 | | /// Gets or sets the sort ordinal. |
| | 48 | | /// </summary> |
| 0 | 49 | | public byte SortOrdinal { get; set; } |
| | 50 | |
|
| | 51 | | #endregion |
| | 52 | |
|
| | 53 | | #region ITemporal members: |
| | 54 | |
|
| | 55 | | /// <summary> |
| | 56 | | /// End/expiration <see cref="DateTime"/> of the item. |
| | 57 | | /// </summary> |
| 0 | 58 | | public DateTime? EndDate { get; set; } |
| | 59 | |
|
| | 60 | | /// <summary> |
| | 61 | | /// Origin <see cref="DateTime"/> of the item. |
| | 62 | | /// </summary> |
| 0 | 63 | | public DateTime? InceptDate { get; set; } |
| | 64 | |
|
| | 65 | | /// <summary> |
| | 66 | | /// Modification/editorial <see cref="DateTime"/> of the item. |
| | 67 | | /// </summary> |
| 0 | 68 | | public DateTime? ModificationDate { get; set; } |
| | 69 | |
|
| | 70 | | #endregion |
| | 71 | |
|
| | 72 | | /// <summary> |
| | 73 | | /// Represents this instance as a <c>string</c>. |
| | 74 | | /// </summary> |
| | 75 | | public override string ToString() |
| 0 | 76 | | { |
| 0 | 77 | | if (DisplayText != null) |
| 0 | 78 | | return $"{Id}: {DisplayText}"; |
| | 79 | |
|
| 0 | 80 | | return ItemName != null ? $"{Id}: {ItemName}" : $"ID: {Id}"; |
| 0 | 81 | | } |
| | 82 | | } |