According to The Standard, logic doesn't live at the broker because you can't test-drive it.
The existing StorageBroker methods have logic. Sequencing is a kind of logic too, try-catch-finally as well.
Beeing untested, the StorageBroker has a hidden bug. Lets dig into:
private async ValueTask<T> UpdateAsync<T>(T @object)
{
this.Entry(@object).State = EntityState.Modified;
await this.SaveChangesAsync();
DetachEntity(@object);
return @object;
}
If SaveChangesAsync fails, @object will remain Attached and tracked as Modified.
Any subsequent call to a Broker method will update the @object from the failed call.
According to The Standard, logic doesn't live at the broker because you can't test-drive it.
The existing StorageBroker methods have logic. Sequencing is a kind of logic too, try-catch-finally as well.
Beeing untested, the StorageBroker has a hidden bug. Lets dig into:
If SaveChangesAsync fails, @object will remain Attached and tracked as Modified.
Any subsequent call to a Broker method will update the @object from the failed call.