using System.ComponentModel.DataAnnotations; namespace Entity.Api.Req; public partial class ElecPriceModelVersionDetailReq { public DateTime StartTime { get; set; } public DateTime EndTime { get; set; } /// /// 版本 /// public int Version {get;set;} private double _price; /// /// Desc:价格;以分为单位存储 /// Default: /// Nullable:True /// // [SugarColumn(ColumnName="price")] public double Price { get => _price; set { if (value < 0) { throw new ArgumentException("电价不能为负数"); } _price = Math.Round(value, 4); } } /// /// Desc:尖峰平谷类型;1-尖;2-峰;3-平;4-谷 /// public int? Type {get;set;} }