我正在使用ServiceStack构建一些服务,我有以下服务
public class FooRequest: IReturn<FooResponse>
{
public int FooID { get; set; }
public decimal Amount { get; set; }
public string SortColumnName { get; set; }
}
public class FooResponse
{
private List<Payment> payments;
public FooResponse()
{
payments= new List<Payment>();
}
public List<Payment> Payments
{
get { return payments; }
set { payments = value; }
}
}
public class Payment
{
public int ID { get; set; }
public string Amount { get; set; } // Amount is formatted string based on the user language
public decimal PaymentAmount{ get; set; } // this is Alias for Amount
}
从上面的FooResponse,我不想在response/metadata
中显示PaymentAmount。
如果我们将其作为普通变量而不是属性,它将在元数据中不可见。但这应该是其他要求的财产。
ServiceStack
是否可以在响应DTO中限制某些属性?