Exemple #1
0
        public static void Create <TCommand, TTarget>(this ICommandExecutionContext context, ITypedCommandHandler <TCommand, TTarget> handler)
            where TCommand : TypedCommand <TTarget>
        {
            var typeAttribute = AttributeBasedObjectTypeMapping.GetTypeAttibute(typeof(TTarget));

            context.Create(ObjectTypeId.Parse(typeAttribute.TypeIdValue));
        }
Exemple #2
0
        public static void ModifyAttribute <TCommand, TTarget, TValue>(this ICommandExecutionContext context, ITypedCommandHandler <TCommand, TTarget> handler, Expression <Func <TTarget, TValue> > propertyExpression, TValue value)
            where TCommand : TypedCommand <TTarget>
        {
            var propertyInfo        = GetPropertyInfo(propertyExpression);
            var attributeDescriptor = AttributeBasedObjectTypeMapping.CreateAttributeDescriptor(propertyInfo);

            context.ModifyAttribute(attributeDescriptor.AttributeName, value);
        }
Exemple #3
0
        private static string GetRelationName <TTarget, TValue>(Expression <Func <TTarget, TValue> > propertyExpression)
        {
            var propertyInfo = GetPropertyInfo(propertyExpression);

            return(AttributeBasedObjectTypeMapping.CreateRelationDescriptor(propertyInfo).RelationName);
        }