Hi, I just tried with 1.0.654-Unstable
The old failing test now passes.
But I have a new problem, that wasn't happening before.
When I save this:
session.Store(new Model { Amount = 12.34m });
And then query for that amount, this is logged:
Executing query 'Amount:12,34' on index 'dynamic/Models' in 'memory
#18544551'
There are no results, notice the comma in the query. This is a culture
thing, I think.
Here a some tests:
(Use "session.Store(new Model { Amount = 12.34m });" in setup)
/// <summary>
/// passes
/// </summary>
[Fact]
public void CanFindNotRoundedDecimal_InvariantCulture()
{
System.Threading.Thread.CurrentThread.CurrentCulture =
CultureInfo.InvariantCulture;
using (var session = OpenSession())
{
decimal amount = 12.34m;
var found = session.Query<Model>().FirstOrDefault(model =>
model.Amount == amount);
Assert.NotNull(found);
}
}
/// <summary>
/// fails
/// </summary>
[Fact]
public void CanFindNotRoundedDecimal_NL_Culture()
{
System.Threading.Thread.CurrentThread.CurrentCulture =
CultureInfo.GetCultureInfo("NL");
using (var session = OpenSession())
{
decimal amount = 12.34m;
var found = session.Query<Model>().FirstOrDefault(model =>
model.Amount == amount);
Assert.NotNull(found);
}
}
On Feb 6, 1:51 pm, "Oren Eini (Ayende Rahien)" <
aye...@ayende.com>
wrote: