Created
June 21, 2013 16:29
-
-
Save venblee/5832429 to your computer and use it in GitHub Desktop.
Running Store Proc Code First
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
try | |
{ | |
using (var db = new PmsContext()) | |
{ | |
var pa = db.PostalCodes.Distinct().Where(x => x.town.Contains(searchTerm)).ToList(); | |
SqlParameter categoryParam = new SqlParameter("@searchTerm", searchTerm); | |
var cities = db.Database.SqlQuery<List<Models.PostalCode>>("SearchCity @searchTerm", categoryParam).ToList(); | |
// return db.PostalCodes.Where(x => x.town.Contains(searchTerm)).Distinct().ToList(); | |
return null; | |
} | |
} | |
catch (Exception ex) | |
{ | |
} | |
return new List<Models.PostalCode>(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment