sqlhelp Posted June 19, 2012 Report Posted June 19, 2012 e code ki I am getting error - use the 'new' keyword to create an object instance em wrong undi indulo ? if (totalCouCount == userPref.Cou.Count() && totalPracticesCount == userPref.Prac.Count()) { cs.customized = false; } else { cs.customized = true; }
karna11 Posted June 19, 2012 Report Posted June 19, 2012 [quote name='sqlhelp' timestamp='1340128726' post='1301992504'] e code ki I am getting error - use the 'new' keyword to create an object instance em wrong undi indulo ? if (totalCouCount == [color=#ff0000]userPref[/color].Cou.Count() && totalPracticesCount == userPref.Prac.Count()) { cs.customized = false; } else { cs.customized = true; } [/quote] ee class ki OBject create sesavaa, dheni mundhu code kodaa pettu adhe imp ikkada
sqlhelp Posted June 19, 2012 Author Report Posted June 19, 2012 ok Int32 personID = Convert.ToInt32(cs.currUser); UserPreference userPref = (from up in db.UserPreferences where up.personID == personID select up).FirstOrDefault(); var totalPracticesCount = db.Prac.Count(); var totalCouCount = db.Cou.Count(); /* Temp Fix - To pass user who is loggin in for first time. */ //if (userPref != null) if (totalCourtsCount == userPref.Cou.Count() && totalPracticesCount == userPref.Prac.Count()) { cs.customized = false; } else { cs.customized = true; }
puli_keka Posted June 19, 2012 Report Posted June 19, 2012 cs enti class aa.. aithe is that class static or atleast the property 'customized' static aa otherwise create a new class for cs .. or it if's an object lite and inkokati mamulugu Count property not a method most of the times like if it's a List<> .. so remove braces can you also share the stack trace??
sqlhelp Posted June 19, 2012 Author Report Posted June 19, 2012 cs anedhi viewmodel name.. userpref ki emaina object create cheyala?
karna11 Posted June 19, 2012 Report Posted June 19, 2012 [quote name='sqlhelp' timestamp='1340130016' post='1301992699'] ok Int32 personID = Convert.ToInt32(cs.currUser); UserPreference [color=#FF0000]userPref = new [/color]UserPreference(); [color=#FF0000]userPref[/color] = (from up in db.UserPreferences where up.personID == personID select up).FirstOrDefault(); var totalPracticesCount = db.Prac.Count(); var totalCouCount = db.Cou.Count(); /* Temp Fix - To pass user who is loggin in for first time. */ //if (userPref != null) if (totalCourtsCount == userPref.Cou.Count() && totalPracticesCount == userPref.Prac.Count()) { cs.customized = false; } else { cs.customized = true; } [/quote] idhi try seyyi vasthundhiii
Recommended Posts