TopShelfCustomer/TopShelfCustomer.Api/Services/CouponData.cs
/// <summary>
/// GetCouponsByZipCode:
///
/// Fetches all Coupons from the database with
/// the StoreZipCode value of "zipCode".
/// </summary>
/// <param name="zipCode"> the Zip Code value to query with </param>
/// <returns> A list of applicable Coupons </returns>


Fetches all Coupons from the database with
the StoreZipCode value of "zipCode".
Fetches all Coupons from the database with the StoreZipCode value of " zipCode " .
public List<Coupon> GetCouponsByZipCode ( int zipCode ) {
            SqlDataAccess sql = new SqlDataAccess();
            var p = new { ZipCode = zipCode };      
            var output = sql.LoadData<Coupon, dynamic>( "dbo.spGetCouponsByZipCode", p, "TopShelfDbConnection" );       
            return output;
        }
public List < Coupon > GetCouponsByZipCode ( int zipCode ) { SqlDataAccess sql = new SqlDataAccess ( ) ; var p = new { ZipCode = zipCode } ; var output = sql . LoadData < Coupon , dynamic > ( " " , p , " " ) ; return output ; }
GetCouponsByZipCode:
GetCouponsByZipCode :
//Dynamic parameter object //Fetch the Coupons
A list of applicable Coupons
A list of applicable Coupons
zipCode
int
the Zip Code value to query with
the Zip Code value to query with