score:10
when using linq to entities the linq expression is converted to a sql query to be sent to the database. this is so that the whole table is not pulled into memory.
your problem is that because active is not mapped the database knows nothing about it and therefore cannot make the calculation.
you will either need to move active into your db or change the linq statement to only query on columns that are in your db
Source: stackoverflow.com
Related Query
- Calculated field in model class gives exception
- C# Ef Core Linq Query adding a calculated field to existing query results without using model
- Refactor model bound controller code to a class
- Is there a good source that gives an overview of linq optimizations?
- LINQ Source Code Available
- .NET 4 Code Contracts: "requires unproven: source != null"
- Access Violation Exception during access of field of Object
- Search query gives LINQ to SQL exception
- Exception in System.Data.Entity.dll but was not handled in user code
- How do I represent an option calculated column with EF Code First?
- creating Linq to sqlite dbml from DbLinq source code
- Entity framework calculated field by Expression<Func<T,V>>
- How can i copy data table records of different field name based on mapping list evaluating condition on source data table?
- Casting linq to model class fails "Unable to cast object of type 'System.Data.Entity.Infrastructure.DbQuery`1"
- Linq select query that uses prior property in calculated field
- Linq help - sub query gives null pointer exception
- entity exception was unhandled by user code
- Create a class type in code in .net c#
- Entity Framework Core - Sorting on Calculated Field
- C# linq xml missing element gives throws exception
- Convert a Model Class Collection to Dictionary based on property as KEY using LINQ C#
- Net Core: Find Data Type for any Variable Field in Class
- An exception of type 'System.ArgumentException' occurred in EntityFramework.dll but was not handled in user code
- Object reference not set to an instance of an object model fk and virtual field
- ProtoBuf-Linq error message “ Invalid field in source data: 0”
- LINQ - Group by calculated field
- EF Code First Insert Objects with One to Many gives exception."Store update, insert, or delete statement affected an unexpected number of rows (0)."
- Where clause on field outside Lambda expression class in Linq
- LINQ entity data model generated code error - The type 'DBContexts.Category' already contains a definition for 'ID'
- Null reference exception in my LINQ to XML code
More Query from same tag
- Solving Combinatory Problems with LINQ /.NET4
- Building a dynamic linq Func to return a string
- LINQ To Entity - LINQ to Entities does not recognize the method 'Double Parse(System.String)' method
- How to create a fully dynamic linq query?
- Select players with fixed trophy count and points
- Linq group data in a flattened enumerable
- Column Summing using Linq
- Linq - OfType<> not working as expected
- c# MVC Pass Group Data to View
- Linq: Group the results of several GroupBy
- How do I parallelise this with or without PLINQ?
- linq average of last N
- Sum Dictionary value by Key
- Filter string to array char - 'IEnumerable<char>' does not contain a definition for 'ToCharArray'
- Find csv data in column from list of data via linq
- Total Sum with multiple where clause LINQ
- Is this also considered a subquery?
- Select all Items which intersect
- Linq query with table joins,case statements, count, group by clauses
- Dynamically Instantiate Model object in Entity Framework DB first by passing type as parameter
- Append a IDictionary<string,string> to a WebHeaderCollection
- How extension methods work in background?
- How to compare two lists of objects in C#?
- How group elements in LINQ to get result like Facebook messages
- Linq - How to turn IQueryable<IEnumerable> into IQueryable
- Removing items from an IEnumerable which match items in a List using LINQ
- Index Out of Bounds in Linq.Enumerable
- Convert SQL query result to C# Dictionary in LINQPad
- Which is better? DataTable.Select() or Linq for filtering objects?
- How do lambdas inside linq functions type parameters work?