ardalis / Result

A result abstraction that can be mapped to HTTP response codes if needed.
MIT License
866 stars 107 forks source link

Added CorrelationId property to Result (#120) #122

Closed scottjferguson closed 1 year ago

scottjferguson commented 1 year ago

Added CorrelationId property, ErrorWithCorrelationId() factory method and unit test

ardalis commented 1 year ago

Looks good.

ardalis commented 1 year ago

Fixes #120

corfor commented 1 year ago

May I ask, is there a reason why CorrelationId is not used for other statuses as well? Why only ErrorWithCorrelationId()?

corfor commented 1 year ago

I've got in mind semantics like:

var result = Result<AvailabilitySchedule>.NotFound($"Availability Schedule for part \"{partId}\" not found.")
    .WithCorrelationId(correlationId);
ardalis commented 1 year ago

I mean it might make sense to just have everywhere, right?