score:3
select new
creates instances of a new anonymous type. The query creates a list of these and then you try to cast that to IList<BC_FeedbackBy>
. Create new instances of BC_FeedbackBy
in the query instead.
Something like
select new BC_FeedbackBy()
{
feedbackId =s.FeedbackById ,
feedbackName=s.FeedbackBy ,
})
Source: stackoverflow.com
Related Articles
- query problem with linq: Unable to cast object
- Problem with LINQ to Entities query using Sum on child object property
- Linq to sql as object data source - designer problem with partial classes
- LINQ with String.Join() error: "System.InvalidCastException: Unable to cast object of type '<DistinctIterator>
- linq query getting Unable to cast object of type 'System.Boolean' to type 'System.String'
- Unable to cast object of type 'System.Double' to type 'System.String' linq query
- Unable to cast object of type 'System.Int32' to type 'System.String' in LINQ query
- Unable to cast object of type grouping to datarow after i grouped datatable with linq
- Linq query error - Unable to cast object of type 'V1.Controllers.Loan' to type 'System.IConvertible
- Problem with linq query
- How can I set properties on all items from a linq query with values from another object that is also pulled from a query?
- Linq to entities - SQL Query - Where list contains object with 2 properties (or more)
- Linq with where clause in many-to-many EF Code First object
- Unable to cast object of type System.Func`2 with Int64
- Unable to cast object of type 'System.Data.Entity.Infrastructure.DbQuery`1[]' using linq lambda expression
- Linq cast conversion Xelement error: Unable to cast object of type 'System.Xml.Linq.XElement' to type 'System.IConvertible'
- LINQ query on object with unknown class
- Unable to cast object of type 'WhereSelectListIterator` in LINQ
- LINQ Issue: Unable to cast object of type 'System.Reflection.Module' to type 'System.Reflection.Emit.ModuleBuilder
- Query for existence of an object with LINQ (to Entities)
- How can I speed up this linq query on a List<> with search criteria on 3 attributes in the list object
- Linq query performance with new object in `Where`
- unable to edit DataGridView populated with results of LINQ query
- Linq sub query when using a repository pattern with EF code first
- LINQ Query for An object with 2 collections
- LINQ query to filter list by object property with multiple checks
- how to query a sub object of an object with linq
- How to cast linq query to an object IEnumerable module class type?
- Removing duplicates using LINQ returns "Error removing duplicates: Unable to cast object of type 'System.Int32' to type 'System.String'."
- convert linq to object query to sql query (no linq to sql code or datacontext)
- C# LINQ query on anonymous types containing dynamic list
- C# Linq Contains statement
- hierarchal Data Context and abstraction
- Issue with C# inheritance when using Generics and 'new' modifier to hide a parent's member
- Comparing dates when date my be null
- LINQ Query on EF Core many-to-many relationship
- Entity Framework: DefiningQuery error
- LINQ GroupBy, finding Max from Count (and then some...)
- Get list of entities whose fk related entity does not contain id in list of ids
- Edit Row in LINQ
- C# Linq to XML check if element exists
- Find Biggest Row By Two Values LINQ
- how to get the number of repetitions from List<int>
- How to use union all in LINQ?
- CRM 2011 objects LINQ query
- Unable to cast object of type 'System.DBNull' to type 'System.String' On getting all Products
- LINQ - select from two arrays
- How to get data out of List<Dictionary<string, string>
- Difference between System.Collections.Generic.List<T>.ToArray() and System.Linq.Enumerable.ToArray<T>()?
- Find and change the value of first element in list that meets a requirement, do something else if not found