Esempio n. 1
0
        /// <summary>
        /// Configures the API from a root node.
        /// </summary>
        /// <param name="node">The node.</param>
        /// <param name="configuration">The configuration.</param>
        private static void ConfigureApi(XmlNode node, IServiceConfiguration configuration)
        {
            NodeAttributes attributes = new NodeAttributes(node);
            Type           dtoType    = GetDtoType(attributes.AsString("dtoType"), attributes.AsString("dtoName"), attributes.AsString("path"), attributes.AsString("entityName"), attributes.AsString("entityType"));

            if (dtoType != null)
            {
                string parameterName = attributes.AsString("parameterName");
                if (string.IsNullOrEmpty(parameterName))
                {
                    parameterName = GetParameterName(attributes.AsString("path"), dtoType);
                }
                ApiNode childnode = configuration.AddNode(attributes.AsString("path"), dtoType, parameterName, attributes.AsString("byparent"));
                foreach (XmlNode subnode in node.SelectNodes("api"))
                {
                    ConfigureApi(subnode, childnode);
                }
            }
        }
Esempio n. 2
0
 /// <summary>
 /// Configures the API from a root node.
 /// </summary>
 /// <param name="node">The node.</param>
 /// <param name="configuration">The configuration.</param>
 private static void ConfigureApi(XmlNode node, IServiceConfiguration configuration)
 {
     NodeAttributes attributes = new NodeAttributes(node);
     Type dtoType = GetDtoType(attributes.AsString("dtoType"), attributes.AsString("dtoName"), attributes.AsString("path"), attributes.AsString("entityName"), attributes.AsString("entityType"));
     if (dtoType != null)
     {
         string parameterName = attributes.AsString("parameterName");
         if (string.IsNullOrEmpty(parameterName))
         {
             parameterName = GetParameterName(attributes.AsString("path"), dtoType);
         }
         ApiNode childnode = configuration.AddNode(attributes.AsString("path"), dtoType, parameterName, attributes.AsString("byparent"));
         foreach (XmlNode subnode in node.SelectNodes("api"))
         {
             ConfigureApi(subnode, childnode);
         }
     }
 }