Map <T> getMap <T>(WorksheetPart sheet) where T : new() { switch (_config.SkipMode) { case SkipModeEnum.None: return(new Map <T>(sheet.GetCaptionCells().ToDictionary(x => x.CellReference.Value, x => getValue(x, typeof(string)).ToString()))); case SkipModeEnum.Manual: return(new Map <T>(sheet.GetCaptionCells(_config.SkipCount.Value).ToDictionary(x => x.CellReference.Value, x => getValue(x, typeof(string)).ToString()))); case SkipModeEnum.Auto: return(autoMap <T>(sheet)); default: throw new NotImplementedException("Default switch case not implemented"); } }