Exemple #1
0
        internal XmlSchema GetQuerySchema()
        {
            var schema = new XmlSchema {
                TargetNamespace = QuerySpace
            };

            schema.Namespaces.Add("", QuerySpace);
            var allParameters = new StringCollection();

            foreach (var queriesForResourceType in _baseQueries.GroupBy(k => k.ResourceKey)
                     .Where(k => _registrationStorage.IsResourceRegistered(k.Key)))
            {
                var group = new XmlSchemaAttributeGroup();
                group.Name = _registrationStorage[queriesForResourceType.Key].ResourceName.Replace(" ", "_");
                var parameters = queriesForResourceType.SelectMany(k => k.Arguments)
                                 .Distinct(_parameterComparer)
                                 .ToArray();

                allParameters.AddRange(parameters);
                foreach (var attr in parameters.Select(k => new XmlSchemaAttribute {
                    RefName = new XmlQualifiedName(k, QuerySpace)
                }))
                {
                    group.Attributes.Add(attr);
                }
                schema.Items.Add(group);
            }
            foreach (var attr in allParameters.OfType <string>().Distinct().Select(
                         k =>
                         new XmlSchemaAttribute
            {
                Name = k,
                SchemaType = XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.String)
            }))
            {
                schema.Items.Add(attr);
            }

            return(schema);
        }
Exemple #2
0
 public object SortedIndexGroupBy()
 {
     return(_sortedIndexed.GroupBy(e => e.Property).Enumerate());
 }
Exemple #3
0
 public object HashIndexGroupBy()
 {
     return(_hashIndexed.GroupBy(e => e.Property).Enumerate());
 }