如何格式化此var以显示返回的日期?
var lastDropStop = shipmentStatus.Stops.LastOrDefault(x => x.StopType.ToUpper() == "DROP");
debugFile.WriteLine("lastDropStop=" + lastDropStop.ToString());
我没有看日期,而是看到了类型名称:
lastDropStop=MyComp.Outbound.Business.Entities.Models.ShipmentStatusStop
答案 0 :(得分:1)
您正在打印该对象,您应该像这样编写属性名称
debugFile.WriteLine("lastDropStop=" + lastDropStop.StopType.ToString()); // or lastDropStop.LastDropStop.ToString() or whatever the property name is