Câu hỏi của tôi là một phần của vấn đề này:
Tôi nhận được một bộ sưu tập id từ một hình thức. Tôi cần lấy các khóa, chuyển đổi chúng thành số nguyên và chọn các bản ghi khớp từ DB.
[HttpPost]
public ActionResult Report(FormCollection collection)
{
var listofIDs = collection.AllKeys.ToList();
// List<string> to List<int>
List<Dinner> dinners = new List<Dinner>();
dinners= repository.GetDinners(listofIDs);
return View(dinners);
}