Ejemplo n.º 1
0
        public bool TryFindMapping(DbException dbException, out ExceptionMapItem mapping)
        {
            var words = new HashSet <string>(_regex.Split(dbException.ToString()));

            mapping = Mappings.FirstOrDefault(a => a.Keywords.IsProperSubsetOf(words));

            return(mapping != null);
        }
Ejemplo n.º 2
0
        public bool TryFindMapping(DbException dbException, out ExceptionMapItem mapping)
        {
            mapping = null;

            var words = new HashSet <string>(Regex.Split(dbException.ToStringFormat(), @"\W"));

            var mappingItem = Mappings.FirstOrDefault(a => a.Keywords.IsProperSubsetOf(words));

            if (mappingItem == null)
            {
                return(false);
            }

            mapping = mappingItem;

            return(true);
        }