52 lines
1.9 KiB
C#
52 lines
1.9 KiB
C#
using System.Collections.Generic;
|
|
|
|
namespace DataConnection.REST.Models
|
|
{
|
|
/// <summary>
|
|
/// Represents basic information about a discovered REST entity without detailed field information.
|
|
/// </summary>
|
|
public class RestEntitySummary
|
|
{
|
|
public string Name { get; set; } = string.Empty;
|
|
public string Label { get; set; } = string.Empty;
|
|
public bool IsCustom { get; set; } = false;
|
|
public string Description { get; set; } = string.Empty;
|
|
public string EntityType { get; set; } = string.Empty; // For distinguishing between different types of entities
|
|
}
|
|
|
|
/// <summary>
|
|
/// Represents information about a discovered REST entity (resource).
|
|
/// </summary>
|
|
public class RestEntityInfo
|
|
{
|
|
public string Name { get; set; } = string.Empty;
|
|
public List<RestPropertyInfo> Properties { get; set; } = new List<RestPropertyInfo>();
|
|
// Add other relevant info like Key properties if needed
|
|
}
|
|
|
|
/// <summary>
|
|
/// Represents information about a property of a discovered REST entity.
|
|
/// </summary>
|
|
public class RestPropertyInfo
|
|
{
|
|
public string Name { get; set; } = string.Empty;
|
|
public string Type { get; set; } = string.Empty; // Type as defined in the metadata (e.g., Edm.String, Edm.Int32)
|
|
public bool IsKey { get; set; } = false;
|
|
public bool IsRequired { get; set; } = false;
|
|
public bool IsReadOnly { get; set; } = false;
|
|
public int? MaxLength { get; set; }
|
|
// Add other relevant info like Nullable, MaxLength etc. if needed
|
|
}
|
|
|
|
/// <summary>
|
|
/// Represents the result of a REST entity creation operation.
|
|
/// </summary>
|
|
public class RestEntityCreationResult
|
|
{
|
|
public bool Success { get; set; }
|
|
public string? ErrorMessage { get; set; }
|
|
public Dictionary<string, object>? CreatedEntity { get; set; }
|
|
public string? CreatedEntityId { get; set; }
|
|
}
|
|
}
|