You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public class DateRange : ValueObject {
public DateRange(DateOnly start, DateOnly end) {
if (start > end) {
throw new InvalidDataException("");
}
Start = start;
End = end;
}
public DateOnly Start { get; private init; }
public DateOnly End { get; private init; }
protected override IEnumerable<object> GetAtomicValues() {
yield return Start;
yield return End;
}
}
public class Program : AggregateRoot<Guid> {
public string Name { get; private set; }
public DateRange DateRange { get; private set; }
public List<Item> Items { get; private init; } = new();
public void Update(string name, DateRange dateRange, IEnumerable<Item> items) {
Name = name;
DateRange = dateRange;
Items.Clear();
Items.AddRange(items);
}
}
var program = await _programRepository.GetAsync(id);
program.Update(name, dateRange, items);
await _programRepository.UpdateAsync(program, true);
when i update the Name field ConcurrencyStamp is worked,
but when i update the DateRange or Items , database has changed and the ConcurrencyStamp not update.
The text was updated successfully, but these errors were encountered:
code example:
when i update the Name field ConcurrencyStamp is worked,
but when i update the DateRange or Items , database has changed and the ConcurrencyStamp not update.
The text was updated successfully, but these errors were encountered: