[HierarchyRoot]
public class Login2Partner : Entity
{
public Login2Partner(Session session) : base(session)
{
}
[Key]
[Field]
public Guid ID { get; private set; }
[Field(Indexed = true)]
[PastConstraint]
public DateTime Inserted { get; set; }
[Field(Nullable = false)]
public Login Login { get; set; }
[Field(Indexed = true, Nullable = false)]
[NotNullOrEmptyConstraint]
public string Partner { get; set; }
[Field(Indexed = true, Nullable = false)]
[NotNullOrEmptyConstraint]
public string Key { get; set; }
[Field(Nullable = true, Indexed = true)]
public string Campaign { get; set; }
}
throw exception on validate:
System.InvalidOperationException: Can not commit a transaction. Entities validation failed. ---> Xtensive.Core.AggregateException: Validation failed. ---> Xtensive.Core.AggregateException: A set of exceptions is caught. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Reflection.AmbiguousMatchException: Ambiguous match found.
at System.RuntimeType.GetPropertyImpl(String name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers)
at System.Type.GetProperty(String name)
at Xtensive.Reflection.DelegateHelper.InnerCreateGetMemberDelegateTObject,TValue,TDelegateType
at Xtensive.Reflection.DelegateHelper.CreateGetMemberDelegateTObject,TValue
at Xtensive.Orm.Validation.PropertyConstraintAspect.GetPropertyGetterTOwner,TProperty
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Xtensive.Orm.Validation.PropertyConstraintAspect.<getpropertyvalue>b__1(PropertyConstraintAspect _this)
at Xtensive.Threading.ThreadSafeCached1.GetValue[T1](Func2 generator, T1 argument)
at Xtensive.Orm.Validation.PropertyConstraintAspect.GetPropertyValue(IValidationAware target)
at Xtensive.Orm.Validation.PropertyConstraintAspect.Check(IValidationAware target)
at Xtensive.Core.ExceptionAggregator.ExecuteT
--- End of inner exception stack trace ---
at Xtensive.Core.ExceptionAggregator.Dispose()
at Xtensive.Orm.Validation.ValidationAwareExtensions.CheckConstraints(IValidationAware target)
at Xtensive.Orm.Persistent.InnerOnValidate()
at Xtensive.Orm.Persistent.Xtensive.Orm.Validation.IValidationAware.OnValidate()
at Xtensive.Orm.Validation.ValidationContext.Validate()
--- End of inner exception stack trace ---
at Xtensive.Orm.Validation.ValidationContext.Validate()
at Xtensive.Orm.Transaction.CompleteValidation()
--- End of inner exception stack trace ---
at Xtensive.Orm.Transaction.CompleteValidation()
at Xtensive.Orm.Transaction.Commit()
at Xtensive.Orm.TransactionScope.Dispose()
...
asked
Jul 27 '11 at 11:14
proff
55●2●6