//[ValidateAntiForgeryToken] public async Task <ActionResult <ApplicationFooter> > Edit(int id, [Bind("Id,ApplicationnId,Title,Content")] ApplicationFooter applicationFooter) { if (id != applicationFooter.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(applicationFooter); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ApplicationFooterExists(applicationFooter.Id)) { return(NotFound()); } else { throw; } } return(Ok()); } return(new JsonResult(applicationFooter)); }
//[ValidateAntiForgeryToken] public async Task <IActionResult> Create([Bind("Id,ApplicationnId,Title,Content")] ApplicationFooter applicationFooter) { if (ModelState.IsValid) { _context.Add(applicationFooter); await _context.SaveChangesAsync(); return(Ok()); } return(new JsonResult(applicationFooter)); }
public async Task <IActionResult> Create([Bind("Id,ApplicationnId,Title,Content")] ApplicationFooter applicationFooter) { if (ModelState.IsValid) { _context.Add(applicationFooter); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(applicationFooter)); }
protected ConsoleApplicationBase() { serviceProvider = CreateServiceProvider(); applicationHeader = CreateApplicationHeader(); ConfigureApplicationHeader(applicationHeader); applicationFooter = CreateApplicationFooter(); ConfigureApplicationFooter(applicationFooter); useCases = CreateUseCaseCollection() ?? new UseCaseCollection(); CreateUseCases(useCases); }
public void Initialize() { commands = CreateCommands() ?? new CommandCollection(); CommandCollectionItem helpCommandItem = CreateHelpCommand(); if (helpCommandItem != null) { commands.Add(helpCommandItem); } applicationHeader = CreateApplicationHeader(); applicationFooter = CreateApplicationFooter(); }
public void Initialize() { IServiceCollection serviceCollection = CreateServiceCollection(); ConfigureServices(serviceCollection); serviceCollection.AddSingleton(serviceCollection); serviceCollection.AddTransient <ICommandModelFactory, CommandModelFactory>(); serviceCollection.AddTransient <ICommandViewFactory, CommandViewFactory>(); ServiceProvider = serviceCollection.BuildServiceProvider(); commands = CreateCommands() ?? new CommandPool(); serviceCollection.AddSingleton(commands); middlewareCollection = ServiceProvider.GetService <MiddlewareCollection>(); applicationHeader = CreateApplicationHeader(); applicationFooter = CreateApplicationFooter(); }
protected virtual void ConfigureApplicationFooter(ApplicationFooter footer) { }