Better Solution would be to create extension method like this
public static DestinationType CastObject(this SourceType obj)
{
var config = new MapperConfiguration(cfg =>
cfg.CreateMap());
var mapper = config.CreateMapper();
var entity = mapper.Map(obj);
return entity;
}