I have a entity set defined as:

public sealed class Folder<T> : EntityBase, IFolder
        [Field(Length = 255, DefaultValue = "")]
        public string Name { get; set; }

        [Association(PairTo = "Parent")]
        public EntitySet<Folder<T>> Folders { get; set; }

        [Association(OnOwnerRemove = OnRemoveAction.Clear, OnTargetRemove = OnRemoveAction.Deny)]
        public Folder<T> Parent { get; set; }

    [HierarchyRoot(InheritanceSchema = InheritanceSchema.ConcreteTable)]
    public abstract class EntityBase : Entity
        [Field, Key]
        public long Id { get; private set; }

When i try to create some instance of this entity and commit transaction, exception is thrown:

System.InvalidOperationException: Can not commit a transaction. Entities validation failed. ---> Xtensive.Core.AggregateException: Validation failed. ---> System.InvalidOperationException: Операции позднего связывания не могут быть выполнены для типов или методов, для которых значение ContainsGenericParameters является true.
   в System.Reflection.RuntimeMethodInfo.ThrowNoInvokeException()
   в System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
   в System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   в System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   в Xtensive.Orm.Validation.PropertyConstraintAspect.<GetPropertyValue>b__1(PropertyConstraintAspect _this)
   в Xtensive.Threading.ThreadSafeCached`1.GetValue[T1](Func`2 generator, T1 argument)
   в Xtensive.Orm.Validation.PropertyConstraintAspect.GetPropertyValue(IValidationAware target)
   в Xtensive.Orm.Validation.PropertyConstraintAspect.Check(IValidationAware target)
   в Xtensive.Orm.Validation.ValidationContext.Validate()
   --- Конец трассировки внутреннего стека исключений ---
   в Xtensive.Orm.Validation.ValidationContext.Validate()
   в Xtensive.Orm.Session.Validate()
   в Xtensive.Orm.Transaction.CompleteValidation()
   --- Конец трассировки внутреннего стека исключений ---
   в Xtensive.Orm.Transaction.CompleteValidation()
   в Xtensive.Orm.Transaction.Commit()
   в Xtensive.Orm.TransactionScope.Dispose()

If i remove [NotNullOrEmptyConstraint] constraint on Name field - everything is going fine. It seems, like you have a bug in code and your code is not ready to process validation on entity with generic parameters used in this manner.

asked Dec 19 '12 at 06:52

Dmitry%20F's gravatar image

Dmitry F

Thanks for the report, unfortunately we were unable to reproduce the problem. Could you please provide more information such as DO, .NET Framework versions you're using. What are the DomainConfiguration settings related to the validation?

(Dec 19 '12 at 07:52) Denis Krjuchkov Denis%20Krjuchkov's gravatar image

I sent mail to support mailbox with project that can reproduce similar problem on DO Version 4.5.3.

(Dec 19 '12 at 18:01) Dmitry F Dmitry%20F's gravatar image

One Answer:

Confirmed and fixed

answered Dec 24 '12 at 03:12

Denis%20Krjuchkov's gravatar image

Denis Krjuchkov

Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
toggle preview


Once you sign in you will be able to subscribe for any updates here



Asked: Dec 19 '12 at 06:52

Seen: 8,233 times

Last updated: Dec 24 '12 at 03:12

powered by OSQA