예제 #1
0
    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);
    }
예제 #2
0
 public Task Post([FromBody] LinkDto value) => linkRepository.Save(value);