Add AutoMapper
This commit is contained in:
15
LaDOSE.Src/LaDOSE.Api/Helpers/AutoMapperTwoWay.cs
Normal file
15
LaDOSE.Src/LaDOSE.Api/Helpers/AutoMapperTwoWay.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using AutoMapper;
|
||||
using AutoMapper.Configuration;
|
||||
|
||||
namespace LaDOSE.Api.Helpers
|
||||
{
|
||||
public static class AutoMapperTwoWay
|
||||
{
|
||||
public static void CreateMapTwoWay<TSource, TDestination>(this IMapperConfigurationExpression mapper)
|
||||
{
|
||||
mapper.CreateMap<TSource, TDestination>().IgnoreAllPropertiesWithAnInaccessibleSetter().IgnoreAllSourcePropertiesWithAnInaccessibleSetter();
|
||||
mapper.CreateMap<TDestination, TSource>().IgnoreAllPropertiesWithAnInaccessibleSetter().IgnoreAllSourcePropertiesWithAnInaccessibleSetter();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user