Tidy ModifyEntityResult
usage
#310
Labels
tech debt/improvement
internal code or workflow improvements
ModifyEntityResult
usage
#310
This is a small, non functional change that is purely around improving developer experience when working with the code.
public class ModifyEntityResult<T, TEnum> : IModifyRequest where T : JsonLdBase
is used in ~80 places in the codebase.This class is based on class of same name from Protagonist, where
T
is the type of entity being returnedTEnum
is an enum containing error code and is used to construct problem+json response.I'm suggesting that this class be simplified, suggestion (not many fields missed for brevity):
In addition to tidying signature, this class is passed around more than it needs to be. Rather than passing
ModifyEntityResult<TEnum>
, we could pass the error enum only. This can then be converted to aModifyEntityResult<TEnum>
in mediatr handler or controller (ie close to returning as it contains details for generating http response).Also, consider renaming
ModifyCollectionType
or adding a new Enum for Manifests.This isn't a huge change but is fairly wide reaching hence specific ticket to arrange timing.
The text was updated successfully, but these errors were encountered: