Gets a little more validation working and creating using the new Save models

This commit is contained in:
Shannon
2015-10-07 17:16:42 +02:00
parent 33906c7730
commit 97c352030a
9 changed files with 118 additions and 54 deletions

View File

@@ -0,0 +1,20 @@
using AutoMapper;
namespace Umbraco.Core.Models.Mapping
{
internal static class MappingExpressionExtensions
{
/// <summary>
/// Ignores all unmapped members by default - Use with caution!
/// </summary>
/// <typeparam name="TSource"></typeparam>
/// <typeparam name="TDest"></typeparam>
/// <param name="expression"></param>
/// <returns></returns>
public static IMappingExpression<TSource, TDest> IgnoreAllUnmapped<TSource, TDest>(this IMappingExpression<TSource, TDest> expression)
{
expression.ForAllMembers(opt => opt.Ignore());
return expression;
}
}
}