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
 public static void Detach <TCommand, TTarget, TValue>(this ICommandExecutionContext context, ITypedCommandHandler <TCommand, TTarget> handler, Expression <Func <TTarget, TValue> > propertyExpression, ObjectId refereeId)
     where TCommand : TypedCommand <TTarget>
 {
     DoDetach(propertyExpression, context, refereeId);
 }
Exemplo n.º 4
0
 public static IEnumerable <ObjectId> GetRelated <TCommand, TTarget, TValue>(this ICommandExecutionContext context, ITypedCommandHandler <TCommand, TTarget> handler, Expression <Func <TTarget, TValue> > propertyExpression)
     where TCommand : TypedCommand <TTarget>
 {
     return(context.GetRelated(GetRelationName(propertyExpression)));
 }