コード例 #1
0
        public static ServiceOperationSchema GetServiceOperationSchema(Type interfaceType, MethodInfo methodInfo, Boolean thowError = false)
        {
            ServiceOperationSchema schema = null;
            Int32 hashcode = methodInfo.GetHashCode();

            if (!_ServiceOperationSchemaTable.TryGetValue(hashcode, out schema))
            {
                lock (_ServiceOperationSchemaTableLock)
                {
                    if (!_ServiceOperationSchemaTable.TryGetValue(hashcode, out schema))
                    {
                        schema = ServiceModelSchema.SchemaLoadSource.GetServiceOperationSchema(interfaceType, methodInfo);
                        if (schema != null)
                        {
                            _ServiceOperationSchemaTable.TryAdd(hashcode, schema);
                        }
                        else if (thowError)
                        {
                            throw ExceptionCode.UnidentifiedServiceOperationOnMethod.NewException();
                        }
                    }
                }
            }
            return(schema);
        }
コード例 #2
0
        public ServiceOperationSchema GetServiceOperationSchema(Type interfaceType, MethodInfo operation)
        {
            ServiceOperationSchema schema = new ServiceOperationSchema();

            schema.Name       = operation.Name;
            schema.MethodInfo = operation;

            Object[] attributes = operation.GetCustomAttributes(typeof(ServiceOperationAttribute), true);
            if (attributes.Length > 0)
            {
                var attribute = attributes[0] as ServiceOperationAttribute;
                schema.Name = attribute.Name;
            }
            return(schema);
        }
コード例 #3
0
 public static String GetOperationPath(ServiceInterfaceSchema interfaceSchema, ServiceOperationSchema operationSchema)
 {
     return(GetOperationPath(interfaceSchema.Name, operationSchema.Name));
 }