TinyMapper: calls TinyMapper.Bind <TTarget, TSource> (); cause performance issues? Should it be called only once?
I have an assembly that contains a class that maps objects from my Dal objects to Business objects. This class displays several different objects (Profile, Address, etc.). I am replacing a TinyMapper card. Generally:
1. List display method
public IEnumerable<TTarget> MapFromDal(IEnumerable<TSource> source){
return source.Select(MapSingleFromDal);
}
Single Object Matching Method
public TTarget MapSingleFromDal(TSource source){
//By hand mapping code.
}
When replacing the mapping code with TinyMapper, where should I put my Bind statement? Is it often worth calling often? My first cut in this, I just put this line in my MapSingleFromDal method:
TinyMapper.Bind<TTarget, TSource>();
. , , . ? , ?
TinyMapper.Bind<T1,S1>();
TinyMapper.Bind<T2,S2>();
TinyMapper.Bind<T3,S3>();
, TinyMapper.Bind<T1,S1>();? ?
+4