如何在Breeze元数据中包含只读计算属性?
我有一个模型类,它有一个名为Birthday的属性,它是如何在Breeze元数据中包含只读计算属性?,breeze,Breeze,我有一个模型类,它有一个名为Birthday的属性,它是DateTime?属性。我还有一个只读的计算列,如下所示: public int? RacingAge { get { if (!Birthday.HasValue) return null; else return DateTime.Today.Year - Birthday.Value.Year; } } 当我运行查询时,这个值会在返回的Json中返回,但是属性不是元数据的一部分
DateTime?
属性。我还有一个只读的计算列,如下所示:
public int? RacingAge
{
get
{
if (!Birthday.HasValue)
return null;
else
return DateTime.Today.Year - Birthday.Value.Year;
}
}
当我运行查询时,这个值会在返回的Json中返回,但是属性不是元数据的一部分,因此不会设置它
我需要做什么才能强制将其包含在元数据中?好问题。探索它。请继续关注。看一看哪一个显示了如何将计算出的属性引入到您的模型中。1月以来发生了很多事情。