/// <summary> /// Creates an instance from separate services for the various individual read and write methods. /// </summary> protected BaseJsonApiController( IJsonApiOptions options, ILoggerFactory loggerFactory, IGetAllService <TResource, TId> getAll = null, IGetByIdService <TResource, TId> getById = null, IGetSecondaryService <TResource, TId> getSecondary = null, IGetRelationshipService <TResource, TId> getRelationship = null, ICreateService <TResource, TId> create = null, IAddToRelationshipService <TResource, TId> addToRelationship = null, IUpdateService <TResource, TId> update = null, ISetRelationshipService <TResource, TId> setRelationship = null, IDeleteService <TResource, TId> delete = null, IRemoveFromRelationshipService <TResource, TId> removeFromRelationship = null) { ArgumentGuard.NotNull(options, nameof(options)); ArgumentGuard.NotNull(loggerFactory, nameof(loggerFactory)); _options = options; _traceWriter = new TraceLogWriter <BaseJsonApiController <TResource, TId> >(loggerFactory); _getAll = getAll; _getById = getById; _getSecondary = getSecondary; _getRelationship = getRelationship; _create = create; _addToRelationship = addToRelationship; _update = update; _setRelationship = setRelationship; _delete = delete; _removeFromRelationship = removeFromRelationship; }
public ResourceController(IJsonApiOptions options, ILoggerFactory loggerFactory, IGetAllService <Resource, int> getAll = null, IGetByIdService <Resource, int> getById = null, IGetSecondaryService <Resource, int> getSecondary = null, IGetRelationshipService <Resource, int> getRelationship = null, ICreateService <Resource, int> create = null, IAddToRelationshipService <Resource, int> addToRelationship = null, IUpdateService <Resource, int> update = null, ISetRelationshipService <Resource, int> setRelationship = null, IDeleteService <Resource, int> delete = null, IRemoveFromRelationshipService <Resource, int> removeFromRelationship = null) : base(options, loggerFactory, getAll, getById, getSecondary, getRelationship, create, addToRelationship, update, setRelationship, delete, removeFromRelationship) { }
public SetRelationshipProcessor(ISetRelationshipService <TResource, TId> service) { ArgumentGuard.NotNull(service, nameof(service)); _service = service; }
public SetRelationshipProcessor(ISetRelationshipService <TResource, TId> service) { _service = service ?? throw new ArgumentNullException(nameof(service)); }