I have a class App which implements IApp interface class
this IApp interface is like this
interface IApp
{
string Status;
dateTime start;
datetime end;
}
now i want to convert List to List by using Linq
this I can do like this
//AppClassList is a List<App>
List<IApp> result = AppClassList.ConvertAll<IApp>(o => (IApp)o);
but I want to do custom code while converting App to IApp,
like I want to set Status property depend on start and end date diffrence , suppose difference is one day then Status will be “Excellent” if two day then “Good” if three day then “OK” and so on …
Please suggest me how i can do it while converting App to IApp using C#.net
and having this method:
you could write:
or