neuecc / LightNode

Micro RPC/REST Framework built on OWIN
http://neuecc.github.io/LightNode
MIT License
181 stars 32 forks source link

ParseArray remove LINQ #32

Closed neuecc closed 9 years ago

neuecc commented 10 years ago
Func<IEnumerable<string>, object> parseArray = xs =>
{
    var result = new List<DateTime>();
    foreach (var x in xs)
    {
        DateTime @out;
        if (DateTime.TryParse(x, out @out)) result.Add(@out);
        else return new DateTime[0];
    }
    return result.ToArray();
};