using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Abp.Domain.Entities;
using Abp.Domain.Entities.Auditing;
namespace IwbZero.Authorization.Base.SystemInfo
{
///
/// Represents a setting for a tenant or user.
///
[Table("Sys_Settings")]
public class SysSetting : AuditedEntity, IMayHaveTenant
{
///
/// Maximum length of the property.
///
public const int MaxNameLength = 256;
///
/// Maximum length of the property.
///
public const int MaxValueLength = int.MaxValue;
public const int DisplayNameMaxLength = 50;
public const int DescriptionMaxLength = 500;
public const int RemarkMaxLength = 500;
///
/// TenantId for this setting.
/// TenantId is null if this setting is not Tenant level.
///
[Index]
public int? TenantId { get; set; }
///
/// UserId for this setting.
/// UserId is null if this setting is not user level.
///
[Index]
public long? UserId { get; set; }
///
/// Unique name of the setting.
///
[Required]
[StringLength(MaxNameLength)]
public string Name { get; set; }
///
/// Value of the setting.
///
[StringLength(MaxValueLength)]
public string Value { get; set; }
[StringLength(DisplayNameMaxLength)]
public string DisplayName { get; set; }
public int? Type { get; set; }
[StringLength(DescriptionMaxLength)]
public string Description { get; set; }
[StringLength(RemarkMaxLength)]
public string Remark { get; set; }
///
/// Creates a new object.
///
public SysSetting()
{
}
///
/// Creates a new object.
///
/// TenantId for this setting
/// UserId for this setting
/// Unique name of the setting
/// Value of the setting
///
///
public SysSetting(int? tenantId, long? userId, string name, string value, string displayName, int? type = null)
{
TenantId = tenantId;
UserId = userId;
Name = name;
Value = value;
DisplayName = displayName;
Type = type;
}
}
}