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); }
private static string GetRelationName <TTarget, TValue>(Expression <Func <TTarget, TValue> > propertyExpression) { var propertyInfo = GetPropertyInfo(propertyExpression); return(AttributeBasedObjectTypeMapping.CreateRelationDescriptor(propertyInfo).RelationName); }