Click here to Skip to main content
15,879,326 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hi,using firstordefault getting particular record.But i need all values ,How to get all values ? getting error:
The method or operation is not implemented.


Performane_QA is table name. I need update values but values or not updating.

What I have tried:

Controller
Performane_QA updateddata1 = (from c in bics.Performane_QA
                             where c.PerformanceId == updateddata.PerformanceId
                                             select c).ToList();
Posted
Updated 13-Nov-17 19:51pm
Comments
David_Wimbley 6-Oct-17 2:43am    
Your code sample does not show any usage of .FirstOrDefault. So either you didn't show the correct portion of your code or something else is going on but unfortunately no one here is going to be able to help you as we don't have access to your,code know anything about your project nor do we know what it is you are trying to accomplish.

I am guess the issue is with whatever updateddata.PerformanceId is rather than the query itself of updateddata1 but without seeing more of your code, a guess is as good as its going to get.
GrpSMK 6-Oct-17 2:47am    
Performance updateddata = (from c in bics.Performances
where c.EmployeeId == model.EmployeeId
select c).FirstOrDefault();
updateddata.EmployeeId = model.EmployeeId;
updateddata.FirstName = model.FirstName;
updateddata.LastName = model.LastName;
updateddata.PhoneNumber = model.PhoneNumber;
bics.SaveChanges();

Performane_QA updateddata1 = (from c in bics.Performane_QA
where c.PerformanceId == updateddata.PerformanceId
select c).ToList();
//Performane_QA updateddata1=updateddata2;
// var id = updateddata.PerformanceId;

if (model.SelectedAnswer1 != null)
{
// updateddata1.PerformanceId = id;
updateddata1.Question = "Question1";
updateddata1.Value = Convert.ToInt32(model.SelectedAnswer1);

bics.SaveChanges();
}
GrpSMK 6-Oct-17 2:48am    
performance and performance_qa two different tables.Performance id is FK

List<Performane_QA> updateddata1 = (from c in bics.Performane_QA
where c.PerformanceId == updateddata.PerformanceId
select c).ToList();


to get data
---------
foreach(Performane_QA v in updateddata1)
{

string StrPerformanceId=v.PerformanceId;
}


or 

var updateddata1 = (from c in bics.Performane_QA
where c.PerformanceId == updateddata.PerformanceId
select c).ToList();

to get data
---------
foreach(var v in updateddata1)
{

string StrPerformanceId=v.PerformanceId;
}
 
Share this answer
 
var uprowsdetails = bics.Performane_QA.Where(t => t.PerformanceId == updateddata.PerformanceId).ToList();


        uprowsdetails.ForEach(a => a.Field name = value);

           db.SaveChanges();
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900