Exemplo n.º 1
0
        public override Semestre Read(Semestre.ID id)
        {
            using TransactionScope ts = new TransactionScope(TransactionScopeOption.Required);
            Semestre entity = new Semestre();

            EnsureContext();
            context.EnlistTransaction();

            using (IDbCommand cmd = context.createCommand()) {
                cmd.CommandText = SelectCommandText;
                cmd.CommandType = SelectCommandType;
                SelectParameters(cmd, id);
                IDataReader reader = cmd.ExecuteReader();
                while (reader.Read())
                {
                    IDataRecord info = reader;
                    entity = Map(info);
                }
                reader.Close();
            }
            ts.Complete();
            return(entity);
        }
Exemplo n.º 2
0
        protected override void SelectParameters(IDbCommand command, Semestre.ID k)
        {
            SqlParameter p1 = new SqlParameter("@id", k.Ident);

            command.Parameters.Add(p1);
        }