/// <summary> /// /// </summary> /// <exception cref="ServiceModelException">Thrown when unload schema info </exception> /// <param name="interfaceType"></param> /// <param name="info">interface's method info</param> /// <returns></returns> public static ServiceParameterSchema GetServiceReturnParameterSchema(Type interfaceType, MethodInfo info) { ServiceParameterSchema schema = null; Int32 hashcode = info.GetHashCode(); if (!_ServiceReturnParameterSchemaTable.TryGetValue(hashcode, out schema)) { lock (_ServiceOperationReturnParameterLock) { if (!_ServiceReturnParameterSchemaTable.TryGetValue(hashcode, out schema)) { schema = ServiceModelSchema.SchemaLoadSource.GetServiceReturnParameterSchema(interfaceType, info); if (schema != null) { _ServiceReturnParameterSchemaTable.TryAdd(hashcode, schema); } else { throw ExceptionCode.UnloadServiceSchema.NewException(); } } } } return(schema); }
public ServiceParameterSchema GetServiceReturnParameterSchema(Type interfaceType, MethodInfo operation) { ServiceParameterSchema schema = null; var parameterInfo = operation.ReturnParameter; schema = new ServiceParameterSchema(parameterInfo); return(schema); }
public ServiceParameterSchema[] GetServiceInvokeParameterSchemas(Type interfaceType, MethodInfo operation) { ServiceParameterSchema[] schemas = null; var parameterInfos = operation.GetParameters(); schemas = new ServiceParameterSchema[parameterInfos.Length]; for (Int32 i = 0; i < parameterInfos.Length; ++i) { schemas[i] = new ServiceParameterSchema(parameterInfos[i]); } return(schemas); }