我正在编写下一个类作为DocumentDB服务的对象。 使用
Client.CreateDocumentAsync("dbs/" + DBId + "/colls/" + CollectionId, document);
当删除属性[JsonIgnore]时,它的工作正常,它没有写入DB的属性。甚至没有抛出异常。
正在写入数据库的类
public class BaseLogData
{
public int CreationTimeEpoch { get; set; }
[JsonIgnore]
public DateTime CreationTime
{
get
{
return new DateTime(1970, 1, 1).AddSeconds(CreationTimeEpoch);
}
set
{
CreationTimeEpoch = TimeUtils.ToEpoch(value);
}
}
public string RoleName { get; set; }
public string InstanceName { get; set; }
public int? ThreadId { get; set; }
public string CallerFilePath { get; set; }
public string CallerMemberName { get; set; }
public int? CallerLineNumber { get; set; }
public string Message { get; set; }
public string Exception { get; set; }
public string InnerException { get; set; }
public string LogLevel
{
get
{
return _LogLevel.ToString();
}
set
{
_LogLevel = (eLogLevel)Enum.Parse(typeof(eLogLevel), value);
}
}
private eLogLevel _LogLevel { get; set; }
}