解决MySql布尔型新旧版本兼容问题,采用枚举来表示布尔型的数据表。由正向工程赋值
大石头 authored at 2018-05-15 21:21:05
594.00 B
X
using System;

namespace NewLife.Queue.Utilities
{
    public static class Helper
    {
        public static void EatException(Action action)
        {
            try
            {
                action();
            }
            catch
            {
                // ignored
            }
        }
        public static T EatException<T>(Func<T> action, T defaultValue = default(T))
        {
            try
            {
                return action();
            }
            catch (Exception)
            {
                return defaultValue;
            }
        }
    }
}