Esempio n. 1
0
        private static LinqToSqlShared.Mapping.ReturnMapping ReadReturnMapping(XmlReader reader)
        {
            if (!IsInNamespace(reader) || (reader.LocalName != "Return"))
            {
                throw Error.UnexpectedElement("Return", string.Format(CultureInfo.InvariantCulture, "{0}{1}{2}", new object[] { reader.Prefix, string.IsNullOrEmpty(reader.Prefix) ? "" : "/", reader.LocalName }));
            }
            ValidateAttributes(reader, new[] { "DbType" });
            var mapping = new LinqToSqlShared.Mapping.ReturnMapping();

            mapping.DbType = OptionalAttribute(reader, "DbType");
            AssertEmptyElement(reader);
            return(mapping);
        }
 public MappedReturnParameter(ParameterInfo parameterInfo, ReturnMapping map) {
     this.parameterInfo = parameterInfo;
     this.map = map;
 }
        private static ReturnMapping ReadReturnMapping(XmlReader reader) {
            System.Diagnostics.Debug.Assert(reader.NodeType == XmlNodeType.Element);
            if (!IsInNamespace(reader) || reader.LocalName != XmlMappingConstant.Return) {
                throw Error.UnexpectedElement(XmlMappingConstant.Return, String.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}{1}{2}", reader.Prefix, String.IsNullOrEmpty(reader.Prefix) ? "" : "/", reader.LocalName));
            } 

            ValidateAttributes(reader, new[] { 
                                               XmlMappingConstant.DbType
                                           });

            ReturnMapping rm = new ReturnMapping();
            rm.DbType = OptionalAttribute(reader, XmlMappingConstant.DbType);

            AssertEmptyElement(reader);

            return rm;
        }