コード例 #1
0
 /// <summary>
 /// Tests whether the TemplateRules of the concept pass on the provided datatable
 /// </summary>
 /// <param name="dataTable">the data to be tested</param>
 public bool PassesOn(DataTable dataTable)
 {
     // todo: should return waring/error?
     if (TemplateRules == null)
     {
         return(false);
     }
     return(TemplateRules.PassesOn(dataTable));
 }
コード例 #2
0
        internal bool IsApplicable(IPersistEntity entity)
        {
            bool cachedApplicatbilityValue;

            if (_dicCache.TryGetValue(entity.EntityLabel, out cachedApplicatbilityValue))
            {
                return(cachedApplicatbilityValue);
            }

            var data = GetData(entity);
            // MvdEngine.DebugDataTable(data);
            var res = TemplateRules.PassesOn(data);

            try
            {
                _dicCache.Add(entity.EntityLabel, res);
            }
            catch
            {
                // ignored (in case of multi-thread?)
            }
            return(res);
        }