Пример #1
0
        public static XmlSchemaSet Get(ValidationProfile schemaName)
        {
            var ccsch = _Cache["xmlschema_" + schemaName.ToString()] as XmlSchemaSet;

            if (ccsch == null)
            {
                using (
                    var ms =
                        new MemoryStream(
                            Encoding.UTF8.GetBytes(schemaName == ValidationProfile.Lido
                                                       ? XsdSchemas.Lido
                                                       : XsdSchemas.Edm)))
                {
                    var schema       = XmlSchema.Read(ms, null);
                    var xmlSchemaSet = new XmlSchemaSet();
                    xmlSchemaSet.Add(schema);
                    xmlSchemaSet.Compile();



                    ccsch = xmlSchemaSet;

                    Add(schemaName, xmlSchemaSet);
                }
            }

            return(ccsch);
        }
Пример #2
0
 public static void Add(ValidationProfile schemaName, XmlSchemaSet xmlSchemaSet)
 {
     _Cache.Insert("xmlschema_" + schemaName.ToString(), xmlSchemaSet, null, DateTime.Now.AddDays(30), System.Web.Caching.Cache.NoSlidingExpiration, System.Web.Caching.CacheItemPriority.Normal, null);
 }