public static void SeedDocumentType(IDocumentTypeRepository typeRepository) { string[] docTypeList = new string[] { "Invoice", "Legal", "Logistics", "Recruitment", "Other" }; foreach (string docType in docTypeList) { if (typeRepository.FindByNameAsync(docType).Result == null) { DocumentType documentType = new DocumentType() { Type = docType }; try { typeRepository.SaveDocumentTypeAsync(documentType); } catch (Exception ex) { Console.WriteLine(ex); } } } }