public string getRequestTitle(int itemID) { string title; using (var context = new Outa.Models.ApplicationDbContext()) { Request request = context.Requests.Find(itemID); title = request.Title; } return(title); }
public int getOfferCount(int itemID) { int numOffers; using (var context = new Outa.Models.ApplicationDbContext()) { var q = String.Format("SELECT * FROM dbo.Offer WHERE o_Parent = {0}", itemID); var count = context.Offers.SqlQuery(q).ToList(); numOffers = count.Count; } return(numOffers); }
public string getRequestTitle(int itemID) { string title; using (var context = new Outa.Models.ApplicationDbContext()) { Request request = context.Requests.Find(itemID); title = request.Title; } return title; }
public int getOfferCount(int itemID) { int numOffers; using (var context = new Outa.Models.ApplicationDbContext()) { var q = String.Format("SELECT * FROM dbo.Offer WHERE o_Parent = {0}", itemID); var count = context.Offers.SqlQuery(q).ToList(); numOffers = count.Count; } return numOffers; }