internal Result UnregisterService(ServiceName serviceName) { Result rc = ValidateServiceName(serviceName); if (rc.IsFailure()) { return(rc); } if (!Services.Remove(serviceName, out object service)) { return(ResultSm.NotRegistered.Log()); } if (service is IDisposable disposable) { disposable.Dispose(); } return(Result.Success); }
internal Result UnregisterService(ServiceName serviceName) { Result rc = ValidateServiceName(serviceName); if (rc.IsFailure()) { return(rc); } if (!Services.Remove(serviceName, out IServiceObject service)) { return(ResultSm.NotRegistered.Log()); } // ReSharper disable once SuspiciousTypeConversion.Global if (service is IDisposable disposable) { disposable.Dispose(); } return(Result.Success); }
public Result UnregisterService(ReadOnlySpan <char> name) { return(Server.UnregisterService(ServiceName.Encode(name))); }
public Result RegisterService(IServiceObject serviceObject, ReadOnlySpan <char> name) { return(Server.RegisterService(serviceObject, ServiceName.Encode(name))); }