score:3
Accepted answer
wootz = wootz.Where(x => x.CheckClearDate >= new DateTime(DateTime.Now.Year, 1, 1));
That doesn't look right. Entity Framework doesn't understand this constructor. You should be able to fix this part by making it a parameter:
var startOfYear = new DateTime(DateTime.Now.Year, 1, 1);
wootz = wootz.Where(x => x.CheckClearDate >= startOfYear);
A search also brings up EntityFunctions.CreateDateTime
as an alternative.
(Note: I haven't checked if this is the only problem.)
Source: stackoverflow.com
Related Articles
- Exception projecting LINQ to EF to View Model. Getting "only parameterless constructor and initializers" exception
- Trouble with getting linq values to display correctly in view using view model
- Only parameterless constructors and initializers are supported in LINQ to Entities message
- LINQ to Entities only supports casting Entity Data Model primitive types?
- Keep Getting 'The LINQ expression node type 'Invoke' is not supported in LINQ to Entities' Exception
- Use Lambda or Linq to create Model of SelectList with Selected item for razor View in MVC5
- Getting an invalid cast exception when trying to order a list of objects with linq
- Where can I view LINQ source code?
- linq exception : This function can only be invoked from LINQ to Entities
- LINQ Source Code Available
- f#: Only parameterless constructors and initializers are supported in LINQ to Entities
- Only parameterless constructors and initializers are supported in LINQ to Entities
- Tuples - Only parameterless constructors and initializers are supported in LINQ to Entities
- Only parameterless constructors and initializers are supported in LINQ to Entities in linq join with tuples
- linq select sum and average into view model
- How to handle Only parameterless constructors and initializers are supported in LINQ to Entities
- Expression... LINQ to Entities only supports casting Entity Data Model primitive types”
- creating Linq to sqlite dbml from DbLinq source code
- Getting multiple count in EF Model LINQ in single DB call
- LINQ Where clause throws casting exception from string to Guid even though comparison only contains Guids
- Getting "Operation could destabilize the runtime." Exception for hand-constructed LINQ Expression
- Linq - Getting second value only if != null
- Using linq with dynamic model in Razor View
- Only parameterless constructors and initializers are supported in LINQ to Entities
- Getting 'Data source is an invalid type' when binding Linq query to Gridview
- Only parameterless constructors and initializers are supported in LINQ to Entities
- Using LINQ to "transform" two models on a single View Model
- Send Two LINQ Queries using One Model to View
- 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
- Most efficient query to return multiple related entities in Entity Framework Core? (1:M and M:M)
- Query entity select, inner join and count
- Linq with multiple columns while doing a trim() on a column
- Lambda Expression with self reference - what is it doing?
- Is it possible to implement RemoveAll() on EntityCollection<T>?
- Converting SQL query into LINQ - not working
- Create c# class with a table. Sqlite-net
- How to make a SUM of Dictionary Value nested into a list with LINQ?
- Entity Framework Linq SelectMany with condition
- how to use sum function with were condition and isnull check in linq to entity?
- LINQ with JOIN, GROUP, SUM() and return a new SELECT
- How can i make this Linq Statement more sophisticated
- Implicitly-typed local variables must be initialized
- How does this not lead to multiple enumerations of an IEnumerable?
- asp.net order and GroupBy lists in a dictionary in a controller mvc3 class
- C# Select Overload Method With Accumulator Not Working
- Count Distinct - Inner Join - Group By / With the new Linq-to-NHibernate Provider
- EF Core: LINQ Select "many-to-many-to-many" to "many-to-many"
- Group and count list of list items
- Find the object with the longest string