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 Query
- 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
More Query from same tag
- How to find out a child's parent?
- How to create a list by narrowing down another list in c# and linq
- LINQ correlated subqueries
- Use linq to combine 2 classes into a 3rd collection
- linq SubmitChanges method isn't working
- Strategies for replacement of systemic objects
- Enumerable.Skip and ordering
- Equivalent Sql group by to Linq to get value and text properties
- How LinqToSql Generates output result of stored procedures
- Reading XML contents through LINQ to Dropdownlist
- Compiled LINQ joins
- How to query this two XML files using C#?
- How to get isolation level in EF for MSSQL?
- Delete query with Where in LINQ
- Two projections in same IQueryable
- SelectMany nested in parent's lambda vs SelectMany after SelectMany
- Linq return child entities not used in parent entities
- combine foreach loop and linq query into single linq query
- Building combobox with Linq - giving error because multiple entries for same key
- How to mock a 3rd party web service LINQ data provider?
- Extending LINQ to Nhibernate provider, in combination with Dynamic LINQ problem
- Check if object exists in a VB.NET dictionary using Primary Key
- Complex SQL join in LINQ (Normal and Lamba formats)
- LINQ join on a subquery with a union
- Linq query with group by retrieving percentage
- Is there an equivalent in C++ to LINQ with respect to DataTables?
- Linq query & generics
- How to enable average sorting including empty members
- Linq - Sequence contains more than one element
- Generating Permutations for n sets in LINQ