score:3
do you mean this?
getorderlistdatacontext orderlistdactx = new getorderlistdatacontext(address);
var orderlist = from order in orderlistdactx.base_purchase_getorderlistbyuser_ws(request.userguid, request.countrycode, request.fromdate, request.todate)
select new order{
orderkey = order.orderkey,
useremail = order.useremail,
createddate = order.createddate
}
return orderlist.tolist();
score:0
see linq error:
could not find an implementation of the query pattern for source type 'your.type'. 'select' not found. consider explicitly specifying the type of the range variable
it's likely that orderlistdactx.base_purchase_getorderlistbyuser_ws(request.userguid, request.countrycode, request.fromdate, request.todate)
returns type 'ienumerable', but the linq
requires ienumerable<t>
. you have to perform explicit cast:
var orderlist = from order order in orderlistdactx.base_purchase_getorderlistbyuser_ws(request.userguid, request.countrycode, request.fromdate, request.todate)
select order;
i assume, that that base_purchase_getorderlistbyuser_ws
returns collection of order
.
score:1
you can just chain:
var orders = orderlistdactx.base_purchase_getorderlistbyuser_ws(request.userguid, request.countrycode, request.fromdate, request.todate)
.select(order => new order
{
orderkey = order.orderkey,
useremail = order.useremail,
createddate = order.createddate
})
.tolist();
return orders;
score:1
this line showing compiler error could not find implementation of query pattern for source type int select not found
you main problem is from your stored procedure. refer: linq stored procedure issue- returning an int
Source: stackoverflow.com
Related Query
- Avoid extra loop and could not find implementation of query pattern for source type int Select not found
- Could not find an implementation of the query pattern for source type 'System.Data.Entity.DbSet'
- Could not find an implementation of the query pattern for source type
- Could not find an implementation of the query pattern for source type 'System.Data.Entity.DbSet` 'Where' not found
- Could not find an implementation of the query pattern for source type 'Join'
- Getting "Could not find an implementation of the query pattern for source type 'ExcelQueryable<T>'. " Error
- error :Could not find an implementation of query for source type datatable and join not found while trying to join two datatables
- Could not find an implementation of the query pattern
- Could not find an implementation of the query pattern Error
- LINQ query on DataTable - Could not find an implementation of the query pattern
- Could not find an implementation of the query pattern on IEnumerable<T>
- Query LINQ - Could not find an implementation of the query pattern
- Could not find an implementation of the query 'Select' not found
- linq - how do you do a query for items in one query source that are not in another one?
- LINQ query for finding one item in list AND verifying list does not contain another item
- 'IEnumerable<>' does not contain a definition for '' and no extension method '' accepting a first argument of type 'IEnumerable<>' could be found
- Code Example for Add DateTime and TimeSpan in EF query
- ASP.NET LINQ query for filter and loop through multiple tables
- SQL Query to LINQ for MVC with SUM and IS NOT NULL
- LINQ: returning 2 SELECTs in 1 IQueryable for pagination? Keeping in lines with the repository pattern and not changing the return type
- int' does not contain a definition for 'contains' and no extension method 'contains' accepting a first argument of type 'int' could be found
- Find a better query and LINQ for improvement
- What design pattern should I use to create an easy binding map between a query and textboxes for Linq search screens?
- what is the difference between for (or) foreach loop and linq query in case of speed
- "The parameter was not bound in the specified LINQ to Entities query expression." Specification Pattern And
- Encapsulate LINQ query for different Repositories to avoid repeated code
- Contains in LINQ query and Check for Not null
- How to avoid for loop and null comparison to set initial value of a property to a default value
- Linq implementation of for and if loop
- how to fetch data from database using linq query for relationship 1:N and N:N (between 3 entity) in asp.net mvc EF code first?
More Query from same tag
- Get 3 random values from a Dictionary (with tuple string[]) without duplicates
- Handle null element in linq
- Using LINQ to check for anything in a list that is not null or blank
- Linq join 2 entities on a single field and return the matching entries
- How to sort List<T>?
- Group nested list with linq
- Linq query for complex type model
- LINQ Group by where key is an object
- How to sort a dictionary by key
- Linq many to many select query with Distinct
- Linq to Entities with Subselect in select part
- Grouping in LINQ to Entity Model
- Convert IEnumerable<DataRow> to EnumerableRowCollection<DataRow> or DataView
- Reference Key Error in Transaction Scope Using Entity Framework
- C# Return match found with Contains
- How can I make this Android044 = g.Count(i => i.Android044 == 1) return a null if the count is equal to 0?
- Linq join time error
- Flatten XML to DataGridView using C#/Linq
- How to return or display distinct values only from a specific column using EF Core?
- Finding item in list with string name ending in largest number?
- Order By on the Basis of Dictint Group count
- Linq XML complex select (3 levels)
- How do I do a table join using LINQ and entity framework 6?
- Querying Nested Dictionaries using LINQ
- Convert flat object to hierarchy with c#
- LINQ to JSON - Querying an array
- Select a property parameter (Function) from a Generic Item
- GroupBy and OrderBy
- Simplify Entity Framework Core query
- How can I use a Predicate<T> in an EF Where() clause?