public void GenerateRepositories(Template template) { // Get all the tables var tables = _provider.GetTables(template.Entities); foreach (var table in tables) { // Create an repository entity for each table var entity = template.ToRepository(table); // Set the file extensions for the template template.FileNameWithoutExtension = entity.Name; // Generate the contents based on the entity using the PathToTemplate template.Contents = _templateService.Generate(entity, template.PathToTemplate); // Write the template to disk _fileService.Write(template); } }