rewrite DAM to be non-generic
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user