Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Regras Recad grupo
//Title of this code //Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { List<empresa>lst=new List<empresa>(){ new empresa(){nome="A",associado=true,suspenso=false,dataAssociacao=DateTime.MaxValue}, new empresa(){nome="AA",associado=true,suspenso=false,dataAssociacao=DateTime.Now}, new empresa(){nome="B",associado=true,suspenso=true,dataAssociacao=DateTime.Now.AddHours(-1)}, new empresa(){nome="C",associado=false,suspenso=true,dataAssociacao=DateTime.Now}, new empresa(){nome="D",associado=false,suspenso=false,dataAssociacao=DateTime.Now}}; foreach(var item in lst .OrderBy(e=>e.suspenso) .ThenByDescending(e=>e.associado) .ThenBy(e=>e.dataAssociacao)) {Console.WriteLine(item);} } } public class empresa { public string nome{get;set;} public bool associado{get;set;} public bool suspenso{get;set;} public DateTime? dataAssociacao{get;set;} public override string ToString() { return string.Format("{0}-{1}-{2}-{3}",nome, suspenso, associado, dataAssociacao); } } }
run
|
edit
|
history
|
help
0
Random number IF var change
11
datetime
Number of Digits in a Number
Main 5.5
okok2
Funzpoint
Intuit // C# // listing_4.3 (StreamWriter // output.txt)
30272 Program Ex7_2 switch
asdfghjiu