문제

I have a database on windows phone application. I have to-do items and I want to list them grouped like "Today", "Tomorrow" etc. I have a keyedlist based on that and I'm using longlistselector with groups to show data.

I have a date column on database and want to group items by using it. Comparing date with it I want to group items on calling from database like "Today", "Tomorrow", "Other" etc. I tried some let functions but it always throws exception. How can I do when calling it with LINQ?

도움이 되었습니까?

해결책

You will have to instruct the LINQ query that the local part should be done locally:

var tariheGoreGrupla = (from hatirlatma in
                           (from hatirlatmaX in toDoItemsInDB 
                            orderby hatirlatmaX.Due_Date
                            select hatirlatmaX).AsEnumerable()
                       let gun = GetDate(hatirlatma as ToDoItem)
                       group hatirlatma by gun into tariheGore);

AsEnumerable() means "from this point on, use the local enumerable methods and don't try to convert this into an SQL query".

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top