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

            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, UC_Curso.ID k)
        {
            SqlParameter p1 = new SqlParameter("@uc", k.UC);

            command.Parameters.Add(p1);
        }