public object Post(RevertFiles request) { var rootDir = Config.RootDirectory; if (Directory.Exists(rootDir)) { Directory.Delete(rootDir, true); } CopyFiles(rootDir, "~/".MapHostAbsolutePath(), ".cs", ".htm", ".md"); var servicesDir = Path.Combine(rootDir, "services"); CopyFiles(servicesDir, "~/../RestFiles.ServiceInterface/".MapHostAbsolutePath(), "Service.cs"); var testsDir = Path.Combine(rootDir, "tests"); CopyFiles(testsDir, "~/../RestFiles.Tests/".MapHostAbsolutePath(), ".cs"); var dtosDir = Path.Combine(rootDir, "dtos"); var opsDtoPath = dtosDir; CopyFiles(opsDtoPath, "~/../RestFiles.ServiceModel/".MapHostAbsolutePath()); var typesDtoPath = Path.Combine(dtosDir, "Types"); CopyFiles(typesDtoPath, "~/../RestFiles.ServiceModel/Types/".MapHostAbsolutePath()); return new RevertFilesResponse(); }
public object Post(RevertFiles request) { var rootDir = Config.RootDirectory; if (Directory.Exists(rootDir)) { Directory.Delete(rootDir, true); } CopyFiles(rootDir, "~/".MapHostAbsolutePath(), ".cs", ".htm", ".md"); var servicesDir = Path.Combine(rootDir, "services"); CopyFiles(servicesDir, "~/../RestFiles.ServiceInterface/".MapHostAbsolutePath(), "Service.cs"); var testsDir = Path.Combine(rootDir, "tests"); CopyFiles(testsDir, "~/../RestFiles.Tests/".MapHostAbsolutePath(), ".cs"); var dtosDir = Path.Combine(rootDir, "dtos"); var opsDtoPath = dtosDir; CopyFiles(opsDtoPath, "~/../RestFiles.ServiceModel/".MapHostAbsolutePath()); var typesDtoPath = Path.Combine(dtosDir, "Types"); CopyFiles(typesDtoPath, "~/../RestFiles.ServiceModel/Types/".MapHostAbsolutePath()); return(new RevertFilesResponse()); }
public object Post(RevertFiles request) { VirtualFiles.DeleteFolder(Config.RootDirectory); foreach (var file in VirtualFiles.GetDirectory("src").GetAllMatchingFiles("*.*")) { VirtualFiles.WriteFile(file, file.VirtualPath.Replace("src/", Config.RootDirectory)); } return(new RevertFilesResponse()); }