public List <SelectListItem> GetSelectListOperationalSiteLocationsByAssetOwnwer(long assetOwnerID) { AssetOwner assetOwner = repositoryAssetOwner.FindById(assetOwnerID); var data = new List <SelectListItem>(); if (assetOwner.OperationalSiteId != null) { data = repositoryOperationalSiteLocation.GetOperationalSiteLocationsByOwner(assetOwner.OperationalSiteId.Value) .Select(x => new SelectListItem { Value = x.OperationalSiteLocationID.ToString(), Text = x.Location.LocationDescription }) .OrderBy(x => x.Text) .ToList(); } return(data); }
public AssetOwner FindById(long id) { return(repository.FindById(id)); }