¡@

Home 

c# Programming Glossary: asenumerable

EF Distinct (IEqualityComparer) Error

http://stackoverflow.com/questions/1010944/ef-distinct-iequalitycomparer-error

Distinct call in .NET code. To make sure that happens use AsEnumerable to turn IQueryable T into IEnumerable T var result myEntity.MyDomainEntity.. myDomainEntity myDomainEntity.MySpecialID default int .AsEnumerable .Distinct new FooComparer Of course at that point you'll be..

Group by Weeks in LINQ to Entities

http://stackoverflow.com/questions/1059737/group-by-weeks-in-linq-to-entities

than LINQ to Entities for the grouping using a call to the AsEnumerable extension method. Try the following DateTime firstDay GetFirstDayOfFirstWeekOfYear.. from t in context.TrackedTimes.Where myPredicateHere .AsEnumerable group t by new t.User.UserName WeekNumber t.TargetDate firstDay..

LINQ query on a DataTable

http://stackoverflow.com/questions/10855/linq-query-on-a-datatable

doesn't implement IEnumerable T . You need to use the AsEnumerable extension for DataTable . Like so var results from myRow in.. DataTable . Like so var results from myRow in myDataTable.AsEnumerable where myRow.Field int RowNo 1 select myRow And as Keith says.. need to add a reference to System.Data.DataSetExtensions AsEnumerable returns IEnumerable DataRow . If you need to convert IEnumerable..

Linq “Could not translate expression… into SQL and could not treat it as a local expression.”

http://stackoverflow.com/questions/1264985/linq-could-not-translate-expression-into-sql-and-could-not-treat-it-as-a-loc

linq to sql share improve this question You could use AsEnumerable on the entity but that would force it to bring back all the.. tel null null ent.Extension var q2 from row in q1.AsEnumerable select new row.Name FormattedNumber FormatNumber row.Number..

Preserving order with LINQ

http://stackoverflow.com/questions/204505/preserving-order-with-linq

You can map a source element by index to a result element AsEnumerable Cast Concat Select ToArray ToList Preserves Order. Elements..

Understanding .AsEnumerable() in LINQ to SQL

http://stackoverflow.com/questions/3311244/understanding-asenumerable-in-linq-to-sql

.AsEnumerable in LINQ to SQL Given the following LINQ to SQL query var test.. that the conventional way to accomplish this is to do AsEnumerable thus converting it to a workable object. Given this updated.. object. Given this updated code var test from i in Imports.AsEnumerable where i.IsActive select new Make some method call And updated..

Am I misunderstanding LINQ to SQL .AsEnumerable()?

http://stackoverflow.com/questions/3389855/am-i-misunderstanding-linq-to-sql-asenumerable

I misunderstanding LINQ to SQL .AsEnumerable Consider this code var query from a in db.Table where a SomeCondition.. a in db.Table where a SomeCondition select a.SomeNumber .AsEnumerable int recordCount query.Count int totalSomeNumber query.Sum decimal.. an average at the end. I thought based on my reading that .AsEnumerable would execute the query using LINQ to SQL then use LINQ to Objects..

Convert DataTable to IEnumerable<T>

http://stackoverflow.com/questions/3392612/convert-datatable-to-ienumerablet

tankReadings.Add tankReading return tankReadings.AsEnumerable The key part being I am creating a List then returning it using.. part being I am creating a List then returning it using AsEnumerable . c# linq datatable ienumerable share improve this question.. Submitted Convert.ToBoolean row Submitted Also the AsEnumerable isn't necessary as List T is already an IEnumerable T share..

Method cannot be translated into a store expression

http://stackoverflow.com/questions/3846716/method-cannot-be-translated-into-a-store-expression

LINQ to Objects . This will require you to invoke the AsEnumerable method for your LINQ to Entities queries prior to calling the.. IQueryable GetEstates return from e in entity.Estates.AsEnumerable let AllCommFeat from f in entity.CommunityFeatures select new..

Differences between IQueryable, List, IEnumerator?

http://stackoverflow.com/questions/4844660/differences-between-iqueryable-list-ienumerator

turn Customers into an IEnumerable Customer by using the AsEnumerable extension method var query from c in db.Customers.AsEnumerable.. extension method var query from c in db.Customers.AsEnumerable where c.CustomerId 5 select c .First This simple change has.. where c.CustomerId 5 select c query from c in db.Customers.AsEnumerable where c.CustomerId 5 select c Like we've talked about the first..

What is the effect of AsEnumerable() on a LINQ Entity?

http://stackoverflow.com/questions/5311034/what-is-the-effect-of-asenumerable-on-a-linq-entity

is the effect of AsEnumerable on a LINQ Entity Reading the questions here and here has given.. insight into the situation and it seems like using the AsEnumerable is memory consuming. Is there a better way to do this LINQ and.. done now is the data that comes out reliable Removing the AsEnumerable results in a Local sequence cannot be used in LINQ to SQL implementations..