using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Rhea.Common; namespace Tiger.IBusiness { public static class ResultExtension { public static Result CatchExceptionWithLog(this Result result, Exception ex, Locale localeMsg, T data) { result.Data = data; return CatchExceptionWithLog(result, ex, localeMsg); } public static Result CatchExceptionWithLog(this Result result, Exception ex, Locale localeMsg) { result.CatchException(ex, localeMsg); Logger.Default.Fatal(ex, localeMsg.Default()); return result; } public static Result CatchExceptionWithLog(this Result result, Exception ex, string msg, T data) { result.Data = data; return CatchExceptionWithLog(result, ex, msg); } public static Result CatchExceptionWithLog(this Result result, Exception ex, string msg = null) { result.CatchException(ex, msg); Logger.Default.Fatal(ex, msg); return result; } public static Result CatchExceptionWithLog(this Result result, Exception ex, Locale localeMsg, object data) { result.Data = data; return CatchExceptionWithLog(result, ex, localeMsg); } public static Result CatchExceptionWithLog(this Result result, Exception ex, Locale localeMsg) { result.CatchException(ex, localeMsg); Logger.Default.Fatal(ex, localeMsg.Default()); return result; } public static Result CatchExceptionWithLog(this Result result, Exception ex, string msg, object data) { result.Data = data; return CatchExceptionWithLog(result, ex, msg); } public static Result CatchExceptionWithLog(this Result result, Exception ex, string msg = null) { result.CatchException(ex, msg); Logger.Default.Fatal(ex, msg); return result; } } }