public void OnGet(Guid id) { var service = new ExtensionService(); Extension = service.GetExtension(id); var firstFile = Extension.Files.FirstOrDefault(); FileContents = firstFile?.Contents; }
public void OnGet(Guid id, string filePath) { var service = new ExtensionService(); Extension = service.GetExtension(id); ExtensionFile = Extension.Files.First( x => String.Equals(x.FullPath, filePath, StringComparison.OrdinalIgnoreCase)); FileContents = ExtensionFile?.Contents; }
public void OnPost(Guid id) { var service = new ExtensionService(); Extension = service.GetExtension(id); var firstFile = Extension.Files.FirstOrDefault(); if (firstFile == null) { firstFile = new ExtensionFile(); Extension.Files.Add(firstFile); } firstFile.Contents = FileContents; service.SaveExtensions(); }
public void OnGet(Guid id) { var service = new ExtensionService(); Extension = service.GetExtension(id); var firstFile = Extension.Files.FirstOrDefault(); if (firstFile != null && !string.IsNullOrEmpty(firstFile.Contents)) { var result = _DynamicCodeService.GetAssemblyFromText(firstFile.Contents, Extension.ExtensionName); if (result.Succeeded) { var extension = _DynamicCodeService.GetExtensionFromAssembly(result.Assembly); Summary = extension.GetSummary(); } else { CompilerErrors = result.CompilerErrors; } } }