Exemplo n.º 1
0
        public void OnPost(Guid id, string filePath)
        {
            var service = new ExtensionService();

            Extension     = service.GetExtension(id);
            ExtensionFile = Extension.Files.First(
                x => String.Equals(x.FullPath, filePath, StringComparison.OrdinalIgnoreCase));
            ExtensionFile.Contents = FileContents;
            service.SaveExtensions();
        }
Exemplo n.º 2
0
        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();
        }