protected void Submit_Click(object sender, EventArgs e) { if (!IsValid) { return; } Link link; if (Submit.CommandName == CMD_UPDATE) { link = LinkRepository.FindById(DataUtility.ParseInt(QsLinkId)); PopulateLinkFromControls(link); LinkRepository.Update(link); } else if (Submit.CommandName == CMD_INSERT) { link = new Link(); PopulateLinkFromControls(link); LinkRepository.Save(link); } Response.Redirect(Cancel.NavigateUrl); }
public Task Post([FromBody] LinkDto value) => linkRepository.Save(value);