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
R Ravula
NA
20
9.7k
Convert LINQ C# to normal C# code
Aug 11 2013 10:08 AM
Hi,
Can you please help me converting below two LINQ queries (Inside foreach loops) to normal/regular C# code:
DirectoryInfo di = new DirectoryInfo(path);
try
{
DirectoryInfo[] subdirs = di.GetDirectories();
foreach (DirectoryInfo dinfo in subdirs)
{
var files = dinfo.GetFiles("*").Where(w=>(w.LastWriteTime<=DateTime.Now.AddMonths(-6))).OrderByDescending(s => s.LastWriteTime).GroupBy(e => e.LastWriteTime.Month).ToList();
foreach (var item in files)
{
SaveZip(item.Select(s=>s).ToList());
}
}
Thanks,
R
Reply
Answers (
6
)
simple form by MVC4 using linq to sql
Get the Total Count of TimeStamp in LINQ