Click here to Skip to main content
15,867,568 members
Home / Discussions / C#
   

C#

 
QuestionAlgorithms which Max(x) Min(y) Pin
Swab.Jat22-Jan-14 17:18
Swab.Jat22-Jan-14 17:18 
QuestionDynamic created radio buttons wont execute event on click (c# .net ) Pin
salar136922-Jan-14 14:34
salar136922-Jan-14 14:34 
AnswerRe: Dynamic created radio buttons wont execute event on click (c# .net ) Pin
Kornfeld Eliyahu Peter22-Jan-14 20:13
professionalKornfeld Eliyahu Peter22-Jan-14 20:13 
GeneralRe: Dynamic created radio buttons wont execute event on click (c# .net ) Pin
salar136923-Jan-14 8:30
salar136923-Jan-14 8:30 
GeneralRe: Dynamic created radio buttons wont execute event on click (c# .net ) Pin
Kornfeld Eliyahu Peter23-Jan-14 8:34
professionalKornfeld Eliyahu Peter23-Jan-14 8:34 
GeneralRe: Dynamic created radio buttons wont execute event on click (c# .net ) Pin
Gopi Kishan Mariyala22-Jan-14 22:24
Gopi Kishan Mariyala22-Jan-14 22:24 
GeneralRe: Dynamic created radio buttons wont execute event on click (c# .net ) Pin
salar136923-Jan-14 6:53
salar136923-Jan-14 6:53 
QuestionPainfully Slow Operation Pin
eddieangel22-Jan-14 11:07
eddieangel22-Jan-14 11:07 
I am trying to root out why this particular linq query is so expensive from a time standpoint, assuming it is the linq query that is causing it.

C#
public static List<DocumentType> GetDocs()
        {
            List<DocumentType> output;
            using (context = contextLogic())
            {
                output = (from d in context.DocumentTypes
                          select d).AsEnumerable().Select (x => new DocumentType
                          {
                              Id = x.iD,
                              Name = x.Name,
                              FlagA = x.FlagA,
                              IsActive = x.IsActive,
                              UpdateDate = x.UpdateDate,
                              CategoryName = x.DocumentCategory.Name,
                              Associations = string.Join(",", x.DocumentAssociations.Select(g => g.ADocID.ToString()))
                          }).ToList();
            }
            return output;
        }


I tried flipping things around quite a bit. This was initially an observablecollection but it is a list right now as I try to tune it in different ways. Right now it is taking about 12 seconds to retrieve data from a table of 350 records. If I take out the CategoryName and the associations it times down to about six seconds, but that is still ridiculously slow.
AnswerRe: Painfully Slow Operation Pin
Matt T Heffron22-Jan-14 14:19
professionalMatt T Heffron22-Jan-14 14:19 
GeneralRe: Painfully Slow Operation Pin
eddieangel23-Jan-14 5:51
eddieangel23-Jan-14 5:51 
GeneralRe: Painfully Slow Operation Pin
Dave Kreskowiak23-Jan-14 7:48
mveDave Kreskowiak23-Jan-14 7:48 
GeneralRe: Painfully Slow Operation Pin
eddieangel23-Jan-14 7:59
eddieangel23-Jan-14 7:59 
QuestionRead XML values (attributes and elements) with C# Pin
SJR_122-Jan-14 5:14
SJR_122-Jan-14 5:14 
AnswerRe: Read XML values (attributes and elements) with C# Pin
Christian Wulff22-Jan-14 23:38
Christian Wulff22-Jan-14 23:38 
GeneralRe: Read XML values (attributes and elements) with C# Pin
SJR_123-Jan-14 4:59
SJR_123-Jan-14 4:59 
GeneralRe: Read XML values (attributes and elements) with C# Pin
Christian Wulff23-Jan-14 5:06
Christian Wulff23-Jan-14 5:06 
GeneralRe: Read XML values (attributes and elements) with C# Pin
SJR_123-Jan-14 5:33
SJR_123-Jan-14 5:33 
GeneralRe: Read XML values (attributes and elements) with C# Pin
Christian Wulff23-Jan-14 7:44
Christian Wulff23-Jan-14 7:44 
GeneralRe: Read XML values (attributes and elements) with C# Pin
SJR_123-Jan-14 9:03
SJR_123-Jan-14 9:03 
QuestionWindows Process and MEF Pin
Member 1027274822-Jan-14 3:13
Member 1027274822-Jan-14 3:13 
AnswerRe: Windows Process and MEF Pin
Eddy Vluggen22-Jan-14 8:28
professionalEddy Vluggen22-Jan-14 8:28 
AnswerRe: Windows Process and MEF Pin
Ron Beyer22-Jan-14 8:40
professionalRon Beyer22-Jan-14 8:40 
Questionexecuting rake from C# app Pin
lune1221-Jan-14 22:44
lune1221-Jan-14 22:44 
AnswerRe: executing rake from C# app Pin
Pete O'Hanlon21-Jan-14 23:02
subeditorPete O'Hanlon21-Jan-14 23:02 
GeneralRe: executing rake from C# app Pin
lune1222-Jan-14 0:33
lune1222-Jan-14 0:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.