public async Task <IActionResult> Create([Bind("AppTenantId,Name,Title,Hostname,ThemeName,ThemeId,ConnectionString,Folder,RequireSSL,OwnerUserName,TrialEndDate,CreateDate")] AppTenant appTenant) { if (ModelState.IsValid) { _context.Add(appTenant); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["ThemeId"] = new SelectList(_context.Themes, "Id", "CreatedBy", appTenant.ThemeId); return(View(appTenant)); }
public async Task <IActionResult> AddTenant(Request request) { Tenant tenant = new Tenant(); tenant.Name = request.Name; tenant.Hostname = request.Hostname; tenant.SecretKey = request.SecretKey; tenant.APIKey = request.APIKey; tenant.ConnectionString = request.ConnectionString; _Db.Tenants.Add(tenant); await _Db.SaveChangesAsync(); return(Ok()); }