Esempio n. 1
0
 public static void IgnoreAllByDefault(this JsonMap jsonMap)
 {
     jsonMap.Actions.Insert(
         0,
         (member, property, mode) =>
     {
         property.ShouldSerialize = instance => false;
     });
 }
Esempio n. 2
0
 public static void NamingConvention <T>(this JsonMap <T> jsonMap, Func <string, string> renamer)
 {
     jsonMap.Actions.Add((member, property, mode) =>
     {
         {
             property.PropertyName    = renamer(member.Name);
             property.ShouldSerialize = instance => true;
         }
     });
 }
Esempio n. 3
0
 public static void Map <T, TProp>(this JsonMap <T> jsonMap, Expression <Func <T, TProp> > expr, string name)
 {
     jsonMap.Map((LambdaExpression)expr, name);
 }
Esempio n. 4
0
 public static void Ignore <T, TProp>(this JsonMap <T> jsonMap, Expression <Func <T, TProp> > expr)
 {
     jsonMap.Ignore((LambdaExpression)expr);
 }