public static void RegisterService(this LocalServiceRegistry localServiceRegistry, object serviceImplementation, Type serviceInterface) { Guid interfaceGuid; if (!AttributeUtilitiesInternal.TryGetInterfaceGuid(serviceInterface, out interfaceGuid)) { throw new ArgumentException($"Service Interface {serviceInterface.FullName} does not expose Guid Attribute!"); } else { localServiceRegistry.RegisterService(serviceImplementation, serviceInterface, interfaceGuid); } }
public static TService GetService <TService>(this RemoteServiceProxyContainer remoteServiceProxyContainer) where TService : class { var serviceInterface = typeof(TService); Guid interfaceGuid; if (!AttributeUtilitiesInternal.TryGetInterfaceGuid(serviceInterface, out interfaceGuid)) { throw new ArgumentException($"Service Interface {serviceInterface.FullName} does not expose Guid Attribute!"); } else { return(remoteServiceProxyContainer.GetService <TService>(interfaceGuid)); } }