这是我的看法
SELECT AmenityValidDatesPriceID, AmenityID, AmenityValidDatesFrom, AmenityValidDatesTo, AddedDate, LastModifyDate, AddedUser, LastModifyUser,
IsDeleted
FROM dbo.DataManagement_Hotels_Amenities_AmenityValidDatesPrice
WHERE (IsDeleted = 0)
它返回我 AmenityValidDatesFrom,AmenityValidDatesTo 作为日期时间
在前端我只需要日期
public List<BLL.Entities.DataManagement_Hotels_Amenities_AmenityValidDatesPrice> SelectByAmenityID(int ID)
{
DAL.DynamicSearchViewDataContext Viewcontext = new DAL.DynamicSearchViewDataContext();
DAL.SelectSectionDataContext SpContext = new DAL.SelectSectionDataContext();
var Query = (from car in Viewcontext.View_DataManagement_Hotel_Amenities_Dates
where car.AmenityID.Equals(ID)
select new BLL.Entities.DataManagement_Hotels_Amenities_AmenityValidDatesPrice
{
AmenityID = (int)car.AmenityID,
//AmenityValidDatesFrom = (DateTime)car.AmenityValidDatesFrom,
//AmenityValidDatesTo = (DateTime)car.AmenityValidDatesTo
AmenityValidDatesFrom = ((DateTime)car.AmenityValidDatesFrom).Date,
AmenityValidDatesTo = ((DateTime)car.AmenityValidDatesTo).Date
}).ToList<BLL.Entities.DataManagement_Hotels_Amenities_AmenityValidDatesPrice>();
return Query;
}
这是我的代码
它给
错误隐式转换