using System; using System.Runtime.Serialization; namespace Masuit.Tools.Mapping.Exceptions { /// /// 找不到属性时出现异常 /// [Serializable] public class PropertyNoExistException : MapperExceptionBase { /// /// 构造函数 /// /// 属性名 /// 对象类型 public PropertyNoExistException(string propertyName, Type typeObject) : base(ValideParameter($"类型“{typeObject}”不存在属性“{propertyName}”", !String.IsNullOrEmpty(propertyName), typeObject != null)) { } /// /// 构造函数 /// public PropertyNoExistException() { } /// /// 构造函数 /// /// 异常信息 public PropertyNoExistException(string exceptionMessage) : base(exceptionMessage) { } /// /// 构造函数 /// /// 序列化信息 /// 上下文 protected PropertyNoExistException(SerializationInfo serializer, StreamingContext context) : base(serializer, context) { } /// /// 构造函数 /// /// 异常信息 /// 内部异常 public PropertyNoExistException(string exceptionMessage, Exception innerException) : base(exceptionMessage, innerException) { } } }