根据其他选择列表选择列表填充

时间:2017-08-14 17:29:46

标签: c# sql lambda asp.net-core

我有点挑剔,我需要一些帮助。下面是表单中选择列表的代码。我需要根据他们从类别列表中选择的类别来填充认证列表。我如何让它工作?

CODE:

// GET: INT_CertificationsXREF/Create
public IActionResult Create()
{
    ViewBag.FullName = UserInformation.Globals.FullName;
    ViewData["INT_CertificationCategoriesID"] = new SelectList(_context.INT_CertificationCategories, "ID", "Category");
    ViewData["INT_CertificationConferredID"] = new SelectList(_context.INT_CertificationConferred, "ID", "ConferredBy");
    ViewData["INT_CertificationsID"] = new SelectList(_context.INT_Certifications, "ID", "Certification").Where(i => i.CategoryID = ViewData["INT_CertificationCategoriesID"]);
    ViewData["RIM_ResourceID"] = new SelectList(_context.RIM_Resource, "ID", "FirstName");
    return View();
}

1 个答案:

答案 0 :(得分:0)

您可以使用包含

功能,使用列表B过滤列表A.
dt[times != 0 & !is.na(times), sum(Frequency), by = Category]
   Category V1
1:   Second  2
2:    Third 34