Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/entity-framework/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 使用linq选择时向实体框架类添加字段_C#_Entity Framework_Linq - Fatal编程技术网

C# 使用linq选择时向实体框架类添加字段

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

我首先使用实体框架6数据库,linq和C#

我有一个表
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.");
 }