コード例 #1
0
        protected void Button6_Click(object sender, EventArgs e)
        {
            IRepository<Pergunta> rep = Locator.GetComponet<IRepository<Pergunta>>();
            Pergunta pergunta = rep.GetById(1);

            OpcaoResposta opcaoResposta = new OpcaoResposta();
            opcaoResposta.Descricao = "Sim";
            opcaoResposta.Ordem = 1;
            opcaoResposta.RequerJustificativa = true;

            pergunta.AddOpcaoResposta(opcaoResposta);

            OpcaoResposta opcaoResposta2 = new OpcaoResposta();
            opcaoResposta2.Descricao = "Sim";
            opcaoResposta2.Ordem = 1;
            opcaoResposta2.RequerJustificativa = true;

            pergunta.AddOpcaoResposta(opcaoResposta2);

            rep.Save(pergunta);
        }
コード例 #2
0
ファイル: Pergunta.cs プロジェクト: ViniciusConsultor/elias
 public virtual void RemoveOpcaoResposta(OpcaoResposta opcaoResposta)
 {
     opcoesDeResposta.Remove(opcaoResposta);
 }
コード例 #3
0
ファイル: Pergunta.cs プロジェクト: ViniciusConsultor/elias
 public virtual void AddOpcaoResposta(OpcaoResposta opcaoResposta)
 {
     opcoesDeResposta.Add(opcaoResposta);
     opcaoResposta.Pergunta = this;
 }