Ejemplo n.º 1
0
        private async Task <IEnumerable <SelectListItem> > GetPartnerSelection()
        {
            var partners = await _partners.GetAllPartnersAsync();

            if (partners != null)
            {
                var selectList = partners.Select(p => new SelectListItem
                {
                    Value = p.Id.ToString(),
                    Text  = p.Number
                });
                return(new SelectList(selectList, "Value", "Text"));
            }
            return(new SelectList(null, "Value", "Text"));
        }