Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7174327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:00:55+00:00 2026-05-28T16:00:55+00:00

I am building an MVC-based e-commerce application with MVC3 based on nopCommerce. I am

  • 0

I am building an MVC-based e-commerce application with MVC3 based on nopCommerce. I am needing to restrict the sale of certain products based on zip code. For example, the sale of slingshots is illegal in New Mexico, so if you try and purchase a slingshot from our sight and your zip code is from New Mexico, you are redirected to your shopping cart and informed you cannot purchase the product.

To accomplish this, I have created a SQLCE database of zip codes and given them a bool value of Restricted. I want to take the zip code given by the customer during the checkout process and compare it to the database I have created, determining whether or not it is restricted. Then I will use if statements to handle the order based on the results.

I am new to MVC3 and .Net in general, so my experience is practically null. My research seems to indicate there are several methods for doing this(Linq To SQL, Entity Frameworks, ETC). Is this true? What is the most efficient what to accomplish this comparison?

Edit

After further reading I will make my question more concrete. How do I ask the db “Hey, do you have this zip?” using Linq to Entities?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T16:00:58+00:00Added an answer on May 28, 2026 at 4:00 pm

    After further reading I will make my question more concrete. How do I
    ask the db “Hey, do you have this zip?” using Linq to Entities?

    The answer to your question can be as simple as this:

    var hasZip = db.BannedZipSet.Count(z => z.Zip == userZip) > 0;
    

    Linq-to-Entities converts Linq expressions to SQL statements.

    However, there is a learning curve when setting up Entity Framework for the first time, so take that into consideration.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm building an MVC based web application, each Aggregate of Models has it's own
I am building a Spring MVC based application where I want to redirect user's
I am building my first ASP.Net MVC based app and have a problem accessing
I am building an MVC application in which I am reading a list of
I'm building a MVC web application (using the Spring MVC framework), and I'm a
I'm building a Spring MVC web application with Tiles/JSP as the view technology. Previously
I am building a .NET MVC web application. Is cloud hosting the way to
I'm building a .NET MVC application which will be deployed on a Windows 2003
I'm currently building a Spring MVC application. I was looking to use JSP pages
I'm building my first ASP.NET MVC application and I am having some troubles with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.