public IISDeployInfo ToEntity(IISBuildTargetConfigurationCreateModel m) { return(new IISDeployInfo { ProjectId = m.ProjectId, BuildTargetId = m.BuildTargetId, Info = m.Configuration, CreatedByUserId = m.CreatedByUserId, }); }
public async Task <bool> CreateIISDeployInfo(IISBuildTargetConfigurationCreateModel m) { using (var session = _store.OpenSession()) { try { var e = ToEntity(m); session.Store(e); await session.SaveChangesAsync(); return(true); } catch (Exception exp) { Log.Error(exp, string.Empty); return(false); } } }
public async Task <IActionResult> CreateIISBuildTargetConfiguration([FromForm] IISBuildTargetConfigurationCreateModel model) { var session = await HttpContext.GetSession(); if (session == null) { return(BadRequest()); } model.CreatedByUserId = session.User.Id; var result = await projectRepo.CreateIISDeployInfo(model); if (result == false) { this.AlertError("Could not persist this object."); return(View(model)); } this.AlertSuccess("Operation is successful."); return(RedirectToAction(nameof(Index))); }