示例#1
0
        public override string ProcessContext(string StringContext, IDatabaseContext databaseContext)
        {
            if (databaseContext == null)
            {
                throw new ArgumentNullException(nameof(databaseContext));
            }
            if (StringContext == null)
            {
                throw new Exception($"The provided {nameof(StringContext)} is null");
            }
            ITableModel table = databaseContext.Table;

            if (table == null)
            {
                throw new Exception($"The {nameof(TableModel)} is not set");
            }

            string TrimedStringContext = TrimContextFromContextWrapper(StringContext);

            if (!(table?.Columns ?? new List <IColumnModel>()).Any(m => m.IsIndexed))
            {
                return(String.Empty);
            }

            var result = TemplateHandler.
                         HandleFunctionTemplate
                             (TrimedStringContext, DatabaseContextCopier.CopyWithOverride(databaseContext, table));

            return(result);
        }
示例#2
0
        public override string ProcessContext(string StringContext, IDatabaseContext databaseContext)
        {
            ControlContext(StringContext, databaseContext);
            ITableModel table = databaseContext.Table;
            string      TrimedStringContext = TrimContextFromContextWrapper(StringContext);

            if (!(table?.Columns ?? new List <IColumnModel>()).Any(m => m.IsAutoGeneratedValue))
            {
                return(String.Empty);
            }

            var result = TemplateHandler.
                         HandleFunctionTemplate
                             (TrimedStringContext, DatabaseContextCopier.CopyWithOverride(databaseContext, table));

            return(result);
        }