Updating list(of t) using LINQ
-
Hopefully this will make sense Currently in an application I have a list of questions for example in the class below (have removed the properties for easy reading
public Class SOF
public Question_ID as integer
public Question as string
public ShortAnswer as string
public LongAnswer
end classI need to change the application so that the user can edit the long answer where necessary per client. I the updating of the list could be done with LINQ? if possible can anyone give me a pointer / article to read to achieve my goal? Many thanks Simon
As barmey as a sack of badgers Dude, if I knew what I was doing in life, I'd be rich, retired, dating a supermodel and laughing at the rest of you from the sidelines.
-
Hopefully this will make sense Currently in an application I have a list of questions for example in the class below (have removed the properties for easy reading
public Class SOF
public Question_ID as integer
public Question as string
public ShortAnswer as string
public LongAnswer
end classI need to change the application so that the user can edit the long answer where necessary per client. I the updating of the list could be done with LINQ? if possible can anyone give me a pointer / article to read to achieve my goal? Many thanks Simon
As barmey as a sack of badgers Dude, if I knew what I was doing in life, I'd be rich, retired, dating a supermodel and laughing at the rest of you from the sidelines.
You'll first need to clarify what flavor of Linq you are talking about. Linq to Objects, Linq to SQL, Linq to XML??? There are plenty of articles here and elsewhere. Where have you looked?
I know the language. I've read a book. - _Madmatt
-
You'll first need to clarify what flavor of Linq you are talking about. Linq to Objects, Linq to SQL, Linq to XML??? There are plenty of articles here and elsewhere. Where have you looked?
I know the language. I've read a book. - _Madmatt
Mark thanks for your reply I'm looking at LINQ to objects. I have looked and still looking at articles around both CP and the internet.
As barmey as a sack of badgers Dude, if I knew what I was doing in life, I'd be rich, retired, dating a supermodel and laughing at the rest of you from the sidelines.
-
Mark thanks for your reply I'm looking at LINQ to objects. I have looked and still looking at articles around both CP and the internet.
As barmey as a sack of badgers Dude, if I knew what I was doing in life, I'd be rich, retired, dating a supermodel and laughing at the rest of you from the sidelines.
What are you having difficulty with then?
I know the language. I've read a book. - _Madmatt
-
What are you having difficulty with then?
I know the language. I've read a book. - _Madmatt
I can find the object in a list, but I dont know how to update the found object
As barmey as a sack of badgers Dude, if I knew what I was doing in life, I'd be rich, retired, dating a supermodel and laughing at the rest of you from the sidelines.
-
I can find the object in a list, but I dont know how to update the found object
As barmey as a sack of badgers Dude, if I knew what I was doing in life, I'd be rich, retired, dating a supermodel and laughing at the rest of you from the sidelines.
Linq has nothing to do with updating an object once you have it
List<MyOject> myList = new List<MyObject>();
...assume list is populated...
MyOject obj = myList.First(e => e.Foo == "Bar");
obj.Foo = "New Value";
I know the language. I've read a book. - _Madmatt
-
Linq has nothing to do with updating an object once you have it
List<MyOject> myList = new List<MyObject>();
...assume list is populated...
MyOject obj = myList.First(e => e.Foo == "Bar");
obj.Foo = "New Value";
I know the language. I've read a book. - _Madmatt
Mark Thanks for that Its so obvious now you've shown it thanks :-D
As barmey as a sack of badgers Dude, if I knew what I was doing in life, I'd be rich, retired, dating a supermodel and laughing at the rest of you from the sidelines.
-
Mark Thanks for that Its so obvious now you've shown it thanks :-D
As barmey as a sack of badgers Dude, if I knew what I was doing in life, I'd be rich, retired, dating a supermodel and laughing at the rest of you from the sidelines.
You're welcome
I know the language. I've read a book. - _Madmatt