protected static bool CheckCommonMandatoryFields(string[] headers, string[] mandatoryFields, Dictionary <string, List <string> > errors) { headers = CsvUtils.GetLowercaseFieldsFromCsvHeaders(headers); foreach (var field in mandatoryFields) { if (!headers.Any(x => x == field.ToLowerInvariant())) { errors.AddItem("File", $"Header [{field.WordToWords()}] is missing"); } } if (errors.Count > 0) { errors.AddItem("File", "Please ensure the file headers are correct and correct file type is chosen"); } return(errors.Count == 0); }