public static string GetFileName <T, M>(this T template, ISourceFileMapRepository <T, M> sourceFileMap, string fileName) where T : ITemplate <M> where M : TemplateDataModel { template.DataModel._Template = new FileModel() { CodeName = fileName, Extension = sourceFileMap.GetSourceExtension(template), ProjectFilePath = sourceFileMap.GetSourcePath(template) }; return(template.DataModel._Template.FileName); }
public bool WriteTemplateToFile <T>(T template, ISourceFileMapRepository <T, M> mapRepository) where T : ITemplate <M> { var templateOutput = template.TransformText(); var fullName = mapRepository.GetSourcePath(template) + template.GetFileName(); var hasWritten = _FileService.WriteFileToDisk(fullName, templateOutput); _ProjectFactory.UpdateProjectFileWithFileReference <M>(template); return(hasWritten); }