public void Post([FromBody] CronExecutionFile value) { string dirPath = env.ContentRootPath; dirPath = Path.Combine(dirPath, "cronItems", "v1", value.Name); if (System.IO.File.Exists(dirPath)) { throw new ArgumentException($"file {value.Name} already exists"); } System.IO.File.WriteAllText(dirPath, value.WholeContent()); }
public void Put([FromBody] CronExecutionFile value) { CronExecutionFile data = Get(value.Name).Value; if (data == null) { return; } string dirPath = env.ContentRootPath; dirPath = Path.Combine(dirPath, "cronItems", "v1", value.Name); if (!System.IO.File.Exists(dirPath)) { throw new FileNotFoundException($"file {value.Name} already exists"); } System.IO.File.WriteAllText(dirPath, value.WholeContent()); }