MapperExceptionBase.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. using System;
  2. using System.Runtime.Serialization;
  3. namespace Masuit.Tools.Mapping.Exceptions
  4. {
  5. /// <summary>
  6. /// mapper异常基类
  7. /// </summary>
  8. [Serializable]
  9. public class MapperExceptionBase : Exception
  10. {
  11. /// <summary>
  12. /// 构造函数
  13. /// </summary>
  14. /// <param name="exceptionMessage">异常信息</param>
  15. public MapperExceptionBase(string exceptionMessage) : base(exceptionMessage)
  16. {
  17. }
  18. /// <summary>
  19. /// 无参构造函数
  20. /// </summary>
  21. public MapperExceptionBase()
  22. {
  23. }
  24. /// <summary>
  25. /// 构造函数
  26. /// </summary>
  27. /// <param name="serializer">序列化信息</param>
  28. /// <param name="context">上下文</param>
  29. protected MapperExceptionBase(SerializationInfo serializer, StreamingContext context) : base(serializer, context)
  30. {
  31. }
  32. /// <summary>
  33. /// 构造函数
  34. /// </summary>
  35. /// <param name="exceptionMessage">异常信息</param>
  36. /// <param name="innerException">内部异常</param>
  37. public MapperExceptionBase(string exceptionMessage, Exception innerException) : base(exceptionMessage, innerException)
  38. {
  39. }
  40. /// <summary>
  41. /// 验证参数
  42. /// </summary>
  43. /// <param name="message">消息</param>
  44. /// <param name="conditions">条件</param>
  45. /// <returns>异常信息</returns>
  46. protected static string ValideParameter(string message, params bool[] conditions)
  47. {
  48. return message;
  49. }
  50. }
  51. }