예제 #1
0
 public static void IgnoreAllByDefault(this JsonMap jsonMap)
 {
     jsonMap.Actions.Insert(
         0,
         (member, property, mode) =>
     {
         property.ShouldSerialize = instance => false;
     });
 }
예제 #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;
         }
     });
 }
예제 #3
0
 public static void Map <T, TProp>(this JsonMap <T> jsonMap, Expression <Func <T, TProp> > expr, string name)
 {
     jsonMap.Map((LambdaExpression)expr, name);
 }
예제 #4
0
 public static void Ignore <T, TProp>(this JsonMap <T> jsonMap, Expression <Func <T, TProp> > expr)
 {
     jsonMap.Ignore((LambdaExpression)expr);
 }