C# 使用linq选择时向实体框架类添加字段
我首先使用实体框架6数据库,linq和C# 我有一个表C# 使用linq选择时向实体框架类添加字段,c#,entity-framework,linq,C#,Entity Framework,Linq,我首先使用实体框架6数据库,linq和C# 我有一个表hotel,我想编写一个linq查询来选择hotel的所有列,另外还有一个必须使用数据库中写入的函数选择的字段。我在酒店部分类中添加了一个属性。我不知道如何编写linq查询,以便在代码中使用属性hotel.maxHotelPrice 我的部分课程: partial class hotel() { int maxHotelPrice {get; set;} } 我在edmx中的功能: [EdmFunction("hotelReser
hotel
,我想编写一个linq查询来选择hotel
的所有列,另外还有一个必须使用数据库中写入的函数选择的字段。我在酒店
部分类中添加了一个属性。我不知道如何编写linq查询,以便在代码中使用属性hotel.maxHotelPrice
我的部分课程:
partial class hotel()
{
int maxHotelPrice {get; set;}
}
我在edmx中的功能:
[EdmFunction("hotelReservation.Core.Data", "getmaxHotelPrice")]
public static int getmaxHotelPrice(int Hotel_id, DateTime enter_date, DateTime exit_date)
{
throw new NotSupportedException("Direct calls are not supported.");
}