Sort List<>
Code .NET SQL :: ASP.NET :: C#
Page 1 sur 1
Sort List<>
- Code:
List<Productivity> productivities = (List<Productivity>)Service.Object.Get<Productivity>("IdPart=", part.IdPart);
ProductivityComparer comp = new ProductivityComparer();
productivities.Sort(comp.Compare);
- Code:
public class ProductivityComparer : IComparer<Productivity>
{
public int Compare(Productivity a, Productivity b)
{
int result = DateTime.Compare(a.ApplicationDate, b.ApplicationDate);
return result;
}
}
Code .NET SQL :: ASP.NET :: C#
Page 1 sur 1
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum