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)); }
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); }
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); }
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))); }