Esempio n. 1
0
 public static void ValidateMappedModel <TSource, TDestination>(this Controller c, TSource source, string prefix, params ValidationTag[] tags)
 {
     foreach (var error in ValidationMapper.Map <TSource, TDestination>(source.Validate(tags)))
     {
         c.ModelState.AddModelError(prefix + error.PropertyPath, error.Message);
     }
 }
Esempio n. 2
0
 public static void ValidateMappedModel <TSource, TDestination>(this Controller c, TSource source)
 {
     foreach (var error in ValidationMapper.Map <TSource, TDestination>(source.Validate()))
     {
         c.ModelState.AddModelError(error.PropertyPath, error.Message);
     }
 }