Exemplo n.º 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));
        }
Exemplo n.º 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);
        }
Exemplo n.º 3
0
        private static string GetRelationName <TTarget, TValue>(Expression <Func <TTarget, TValue> > propertyExpression)
        {
            var propertyInfo = GetPropertyInfo(propertyExpression);

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