Skip to content

Instantly share code, notes, and snippets.

@christopherbauer
Created January 10, 2016 19:10
Show Gist options
  • Select an option

  • Save christopherbauer/05e320052672bfbb42ca to your computer and use it in GitHub Desktop.

Select an option

Save christopherbauer/05e320052672bfbb42ca to your computer and use it in GitHub Desktop.
public class Zipcode : ApiController
{
private readonly ZipcodeRepository zipcodeRepository;
public Zipcode(ZipcodeRepository zipcodeRepository)
{
this.zipcodeRepository = zipcodeRepository;
}
public OkNegotiatedContentResult<string> Get(string zipcode, string state)
{
var model = zipcodeRepository.Get(zipcode);
if (model == null || model.State == state)
{
return Ok("true");
}
return Ok("Zipcode not in state!");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment