public Referral GetById(int Id)
        {
            Referral r = null;

            DataProvider.ExecuteCmd(GetConnection, "dbo.PartnerReferral_SelectById"
                , inputParamMapper: delegate(SqlParameterCollection paramCollection)
                {
                    paramCollection.AddWithValue("@Id", Id);
                }
               , map: delegate(IDataReader reader, short set)
               {
                   r = new Referral();

                   int startingIndex = 0;

                   r.Id = reader.GetSafeInt32(startingIndex++);

                   r.PartnerType = reader.GetSafeInt32(startingIndex++);
                   r.PartnerName = reader.GetSafeString(startingIndex++);
                   r.Description = reader.GetSafeString(startingIndex++);
                   r.Url = reader.GetSafeUri(startingIndex++);
                   r.AffiliateCode = reader.GetSafeString(startingIndex++);

                   r.DateAdded = reader.GetSafeDateTime(startingIndex++);
                   r.DateModified = reader.GetSafeDateTime(startingIndex++);
                   r.LanguageCode = reader.GetSafeString(startingIndex++);

               }
               );

            return r;
        }
        public List<Referral> Get()
        {
            List<Referral> list = null;

            DataProvider.ExecuteCmd(GetConnection, "dbo.PartnerReferral_Select"
                , inputParamMapper: delegate(SqlParameterCollection paramCollection)
               {

               }
               , map: delegate(IDataReader reader, short set)
               {
                   Referral r = new Referral();

                   int startingIndex = 0;

                   r.Id = reader.GetSafeInt32(startingIndex++);

                   r.PartnerType = reader.GetSafeInt32(startingIndex++);
                   r.PartnerName = reader.GetSafeString(startingIndex++);
                   r.Description = reader.GetSafeString(startingIndex++);
                   r.Url = reader.GetSafeUri(startingIndex++);
                   r.AffiliateCode = reader.GetSafeString(startingIndex++);

                   r.DateAdded = reader.GetSafeDateTime(startingIndex++);
                   r.DateModified = reader.GetSafeDateTime(startingIndex++);
                   r.LanguageCode = reader.GetSafeString(startingIndex++);

                   if (list == null)
                   {
                       list = new List<Referral>();
                   }

                   list.Add(r);
               }
               );

            return list;
        }