Permalink
Browse files

Use DateTime constructor instead of parsing string (Fix format except…

…ion due to culture difference)
  • Loading branch information...
1 parent dece64a commit 0b9ce997b79eb5757963f5f1734b2e54d3bdb691 @seif seif committed Jul 19, 2011
Showing with 4 additions and 2 deletions.
  1. +4 −2 Solutions/SharpArchCookbook.Infrastructure/Queries/ProductsForSaleQuery.cs
View
6 Solutions/SharpArchCookbook.Infrastructure/Queries/ProductsForSaleQuery.cs
@@ -1,4 +1,6 @@
-namespace SharpArchCookbook.Infrastructure.Queries
+using System.Globalization;
+
+namespace SharpArchCookbook.Infrastructure.Queries
{
using System;
using System.Collections.Generic;
@@ -16,7 +18,7 @@ public class ProductsForSaleQuery : NHibernateQuery<Product>, IProductsForSaleQu
public override IList<Product> ExecuteQuery()
{
return (from product in Session.Query<Product>()
- where product.SellEndDate.Date > DateTime.Parse("5/30/2003")
+ where product.SellEndDate.Date > new DateTime(2003,5,30)
select product).ToList();
}
}

0 comments on commit 0b9ce99

Please sign in to comment.