Skip to main content
1 de 2
pnet
  • 14,9mil
  • 34
  • 113
  • 249

Fazendo assim resolveu

[HttpGet]
        public ActionResult Details(AzureDiscountGroupModel modelD)
        {
            var discount = _azureDiscountGroupService.GetAll();
            var list = new List<ResellerListModel>();

            var resellers = _resellerService.QueryAll()
                .Include(r => r.WhiteLabels)
                .ToList();

            foreach(var item in resellers)
            {
                list.Add(CreateListModelFrom(item));
            }

            ViewBag.Desconto = discount.Where(x => x.Id > 0);

            ViewBag.DetailReseller = list.Where(x => x.AzureDiscountGroupId == modelD.Id).ToList();

            return View(modelD);
        }

E na View fiz

@foreach (var item in ViewBag.DetailReseller as List<ResellerListModel>)
    {
    <tr align="center">
        <td>
            @(item.Name)
        </td>
        <td>
            @(item.Alias)
        </td>
        <td>
            @(item.WhiteLabel ? "Sim" : "Não")
        </td>
        <td>
            @(item.MpnId)
        </td>
        <td>
            @(item.CreatedOn)
        </td>
    </tr>
    }
pnet
  • 14,9mil
  • 34
  • 113
  • 249