rewrite DAM to be non-generic

This commit is contained in:
2020-10-16 09:54:09 -04:00
parent 79b3b5be1d
commit 3ce8679d80
13 changed files with 237 additions and 154 deletions

View File

@ -0,0 +1,25 @@
using AutoMapper;
using System.Collections.Generic;
namespace COA.EnterpriseServices.DataAccess
{
public static class AutoMapperExtensions
{
private static readonly IMapper mapper;
static AutoMapperExtensions()
{
mapper = Dependencies.Container.GetInstance<IMapper>();
}
public static T MapTo<T>(this object item)
{
return mapper.Map<T>(item);
}
public static IEnumerable<T> MapTo<T>(this IEnumerable<object> item)
{
return mapper.Map<IEnumerable<T>>(item);
}
}
}