Ejemplo n.º 1
0
 public ResourceMapping(Expression <Func <TEntity, object> > idPointer)
 {
     IdGetter = ExpressionUtils.CompileToObjectTypedFunction(idPointer);
     ResourceRepresentationType = typeof(TEntity);
     PropertyGetters            = new Dictionary <string, Func <object, object> >();
     PropertySetters            = new Dictionary <string, Action <object, object> >();
     PropertySettersExpressions = new Dictionary <string, Expression <Action <object, object> > >();
     Relationships = new List <IRelationshipMapping>();
 }
Ejemplo n.º 2
0
 public ResourceConfigurationBuilder <TResource> WithIdSelector(Expression <Func <TResource, object> > expression)
 {
     ConstructedMetadata.IdGetter = ExpressionUtils.CompileToObjectTypedFunction(expression);
     ConstructedMetadata.IdSetter = CreateIdSetter(ExpressionUtils.GetPropertyInfoFromExpression(expression));
     return(this);
 }
Ejemplo n.º 3
0
 public void AddPropertyGetter(string key, Expression <Func <TEntity, object> > expression)
 {
     PropertyGetters.Add(key, ExpressionUtils.CompileToObjectTypedFunction(expression));
 }
 public ResourceConfigurationBuilder <TResource, TController> WithIdSelector(Expression <Func <TResource, object> > expression)
 {
     BuiltResourceMapping.IdGetter = ExpressionUtils.CompileToObjectTypedFunction(expression);
     BuiltResourceMapping.IdSetter = CreateIdSetter(expression.GetPropertyInfo());
     return(this);
 }
Ejemplo n.º 5
0
 public static void AddPropertyGetter <TEntity, TController>(this ResourceMapping <TEntity, TController> resourceMapping, string key, Expression <Func <TEntity, object> > expression)
 {
     resourceMapping.PropertyGetters.Add(key, ExpressionUtils.CompileToObjectTypedFunction(expression));
 }