-
-
Notifications
You must be signed in to change notification settings - Fork 191
Open
Labels
Description
Code to replicate the issue:
using DynamicData;
using DynamicData.Aggregation;
using DynamicDataRightJoin;
int? max = null;
var cache = new SourceCache<Foo, string>(foo => foo.Id);
var sub = cache
.Connect()
.TransformWithInlineUpdate(
foo => new TransformedFoo(foo.Id)
{
TransformedValue = foo.Value
},
(transformedFoo, foo) =>
{
transformedFoo.TransformedValue = foo.Value;
})
.Maximum(transformedFoo => transformedFoo.TransformedValue)
.Subscribe(newMax =>
{
max = newMax;
});
cache.AddOrUpdate(new Foo("0")
{
Value = 0
});
Console.WriteLine(max); // 0
cache.AddOrUpdate(new Foo("0")
{
Value = 1
});
Console.WriteLine(max); // Expected: 1, Actual: 0
sub.Dispose();
If I understood correctly, this is because:
TransformWithInlineUpdatecallscache.Refresh(change.Key);when inline updating even if the change reason was Update. Is this intended?ForAggregationignores changes which reason is Refresh.
Originally posted by @glrusso in #895 (reply in thread)