public static ServiceInterfaceSchema GetServiceInterfaceSchema(Type interfaceType, Boolean thowError = false) { ServiceInterfaceSchema schema = null; Int32 hashcode = interfaceType.GetHashCode(); if (!_ServiceInterfaceSchemaTable.TryGetValue(hashcode, out schema)) { lock (_ServiceInterfaceSchemaTableLock) { if (!_ServiceInterfaceSchemaTable.TryGetValue(hashcode, out schema)) { schema = ServiceModelSchema.SchemaLoadSource.GetServiceInterfaceSchema(interfaceType); if (schema != null) { _ServiceInterfaceSchemaTable.TryAdd(hashcode, schema); } else if (thowError) { throw ExceptionCode.UnidentifiedServiceInterfaceOnInterfaceType.NewException(); } } } } return(schema); }
public ServiceInterfaceSchema GetServiceInterfaceSchema(Type interfaceType) { ServiceInterfaceSchema schema = new ServiceInterfaceSchema(); schema.Name = interfaceType.Name; schema.InterfaceType = interfaceType; Object[] attributes = interfaceType.GetCustomAttributes(typeof(ServiceInterfaceAttribute), true); if (attributes.Length > 0) { var attribute = attributes[0] as ServiceInterfaceAttribute; schema.Name = attribute.Name; } return(schema); }
public static String GetOperationPath(ServiceInterfaceSchema interfaceSchema, ServiceOperationSchema operationSchema) { return(GetOperationPath(interfaceSchema.Name, operationSchema.Name)); }