예제 #1
0
 /// <summary>
 /// Attempt to map argument values onto the public properties of the given object
 /// instance.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="args"></param>
 /// <param name="obj"></param>
 public static void MapOnto <T>(this IArguments args, T obj)
 {
     Assert.ArgumentNotNull(args, nameof(args));
     CommandArgumentMapper.MapOnto <T>(args, obj);
 }
예제 #2
0
 /// <summary>
 /// Create a new instance of type T and attempt to map argument values into the
 /// public properties of the new object
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <returns></returns>
 public static T MapTo <T>(this IArguments args)
     where T : new()
 {
     Assert.ArgumentNotNull(args, nameof(args));
     return(CommandArgumentMapper.Map <T>(args));
 }