A SQLNETItem used to compile the code or expression.
Ejemplo n.º 1
0
        [SqlMethod(DataAccess = DataAccessKind.Read, SystemDataAccess = SystemDataAccessKind.Read)] // Required for static constructor
        public static SQLNET New(string code)
        {
            if (code.Contains("defaultCommand") && !code.Contains("new SqlConnection("))
            {
                code = TemplateConnection.Replace("[SQLNET_Code]", code);
            }

            var sqlnet = new SQLNET {
                ValueSerializable = EvalManager.DefaultContext.GetNextCacheItemCounter()
            };
            var sqlnetitem = new SQLNETItem {
                Code = code
            };

            EvalManager.CacheItem.TryAdd(sqlnet.ValueSerializable, sqlnetitem);

            return(sqlnet);
        }
Ejemplo n.º 2
0
        [SqlMethod(DataAccess = DataAccessKind.Read, SystemDataAccess = SystemDataAccessKind.Read)] // Required for static constructor
        public static SQLNET New(string code)
        {
            if (code.Contains("defaultCommand") && !code.Contains("new SqlConnection("))
            {
                code = TemplateConnection.Replace("[SQLNET_Code]", code);
            }

            var sqlnet = new SQLNET {ValueSerializable = EvalManager.DefaultContext.GetNextCacheItemCounter()};
            var sqlnetitem = new SQLNETItem {Code = code};
            EvalManager.CacheItem.TryAdd(sqlnet.ValueSerializable, sqlnetitem);

            return sqlnet;
        }