1
我有一個類workHour
,我試圖以serialize
但它只返回ID
(即{ID:1})C#序列化對象只返回ID
public class WorkHour : DomainEntity<int>
{
public virtual Day day { get; set; }
[Key]
public int id;
[Required]
public int dayId { get; set; }
public TimeSpan startTime { get; set; }
public TimeSpan endTime { get; set; }
public DateTime created { get; set; }
public bool deleted { get; set; }
}
對象之前結果序列
|created |{6/14/2017 4:23:50 AM}|
|day |null|
|dayId |1|
|deleted |false|
|endTime |{04:23:50.5419087}|
|id |0|
|startTime|{04:23:50.5419087}|
的返回JSON(結果)其結果是:
{"Id": 18}
顯示的序列化代碼 –