Okay that's what I thought.
Then use the following code
Code:
public IEnumerable<ScriptedInstanceDTO> LoadByMap(short mapId)
{
using (var context = DataAccessHelper.CreateContext())
{
foreach (ScriptedInstance timespaceObject in context.ScriptedInstance.Where(c => c.MapId.Equals(mapId)))
{
// Insert following if clause
if (_mapper == null)
{
continue;
}
// until here
if (_mapper.Map<ScriptedInstanceDTO>(timespaceObject) != null)
{
yield return _mapper.Map<ScriptedInstanceDTO>(timespaceObject);
}
}
}
}
And from now on you shouldn't get this error at this point anymore.
For any reason _mapper doesn't get intialized, maybe later I have time to have a look at the source.
Which files do you have? And did you change something?