TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
rahul ahuj
NA
4
3.3k
Update the list object using linq
Jan 31 2014 6:33 AM
I have list of object's and i want to update the the object's Break property where breakflag=1 with its next and previous record.
class EmployeeHour
{
int recordID{get;set;}
string Break{get;set;}
DateTime TimeIn {get;set;}
DateTime TimeOut {get;set;}
int BreakFlag{get;set;}
}
List<EmployeeHour> listEH=(from item in employeeHoursList
where item.BreakFlag==1
select item).Foreach(itme=>item.Break=(
employeeHoursList[i].Timeout-employeeHoursList[i].TimeIn).ToString()
).ToList();
So here i just want set the break property with the Time diff. between TimeIn and TimeOut only for those objcet whoes breakflag is one. and TimeOut of that object where BeakFlag ==1 and TimeIn next to that object in the list.
Thanks
Rahul.
Reply
Answers (
3
)
DateTime Format Problem Not Getting Exact Result
Diff among Linq, DLinq and PLinq