Duplication of events AddOrUpdate() #695
-
Tell me. Why is there a duplication of events for the following code?
Result:
|
Beta Was this translation helpful? Give feedback.
Answered by
RolandPheasant
May 6, 2023
Replies: 3 comments 2 replies
-
UP! |
Beta Was this translation helpful? Give feedback.
0 replies
-
I cannot replicate. This unit test passes. public record DaysRange(Guid Id, DateTime? Start = null);
[Fact]
public void CannotReplicate()
{
int count = 0;
var daysRanges = new SourceCache<DaysRange, Guid>(daysRange => daysRange.Id);
daysRanges.AddOrUpdate(new DaysRange(Guid.Empty));
daysRanges.Connect()
.Do(_=> count++)
.Sort(SortExpressionComparer<DaysRange>.Ascending(t => t.Start ?? DateTime.MaxValue))
.Bind(out var list )
.DisposeMany()
.Subscribe();
count.Should().Be(1);
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
FoxTes
-
It turns out the problem was in registering ViewModels. She was called twice. Sorry to bother you. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I cannot replicate. This unit test passes.