Пример #1
0
 private static void SetCUDFunctionParametersScalarMapping(TypeBase entityType, XElement functionMappingElement, CUDFunctionParametersMapping cudFunctionParametersMapping, ICSharpCode.Data.EDMDesigner.Core.EDMObjects.SSDL.Function.Function ssdlFunction)
 {
     foreach (var scalarPropertyElement in functionMappingElement.Elements(XName.Get("ScalarProperty", mslNamespace.NamespaceName)))
     {
         var scalarProperty           = entityType.AllScalarProperties.GetByName(scalarPropertyElement.Attribute("Name").Value);
         var parameter                = ssdlFunction.Parameters.GetByName(scalarPropertyElement.Attribute("ParameterName").Value);
         var versionAttribute         = scalarPropertyElement.Attribute("Version");
         var functionParameterMapping = new FunctionParameterMapping {
             SSDLFunctionParameter = parameter
         };
         if (versionAttribute != null)
         {
             functionParameterMapping.Version = versionAttribute.Value.ToLower() == "current" ? FunctionParameterVersion.Current : FunctionParameterVersion.Original;
         }
         cudFunctionParametersMapping[scalarProperty] = functionParameterMapping;
     }
 }
Пример #2
0
 private static void SetCUDFunctionParametersMapping(TypeBase entityType, XElement functionMappingElement, EntityTypeCUDFunctionParametersMapping cudFunctionParametersMapping, ICSharpCode.Data.EDMDesigner.Core.EDMObjects.SSDL.Function.Function ssdlFunction)
 {
     SetCUDFunctionParametersScalarMapping(entityType, functionMappingElement, cudFunctionParametersMapping, ssdlFunction);
     foreach (var complexPropertyElement in functionMappingElement.Elements(XName.Get("ComplexProperty", mslNamespace.NamespaceName)))
     {
         var cudFunctionComplexPropertyParametersMapping = new EntityTypeCUDFunctionParametersMapping();
         var complexProperty = entityType.AllComplexProperties.GetByName(complexPropertyElement.Attribute("Name").Value);
         cudFunctionParametersMapping.ComplexPropertiesMapping.Add(new KeyValuePair <ComplexProperty, EntityTypeCUDFunctionParametersMapping>(complexProperty, cudFunctionComplexPropertyParametersMapping));
         SetCUDFunctionParametersMapping(complexProperty.ComplexType, complexPropertyElement, cudFunctionComplexPropertyParametersMapping, ssdlFunction);
     }
 }