in old application i use seperate map for convert any model to view model and inverse. now i want use generic function but generic function not call sightly map
public class GenericBll<TVModel, TMModel> where TVModel : class where TMModel : class
{
public virtual IEnumerable<TVModel> GetAll()
{
var a = Instance.GetAll_asQuery().ToList();
var b = a.Select(q=> Mapper.Map<TVModel,TMModel>(q)).ToList();
//mapper not return true thing
return b;
}
}
it is my generic mapper
public partial class Mapper
{
internal static TVModel Map<TMModel>(TMModel q) where TMModel : class where TVModel : class
{
//want to this function call another but always run this :(
throw new NotImplementedException();
}
public static MM.GroupDevides Map(GroupDevides e)
{
//map to MM.GroupDevides
}
public static GroupDevides Map(MM.GroupDevides e)
{
//map to GroupDevides
}
}
i,m new in generic type please help