private static SiteDto getSiteDtoFromISite(ISite site) { if (site == null) { throw new Exception("站点不存在!"); } return(SiteDto.ConvertFromSite(site)); }
private static SiteDto GetSiteDtoFromISite(ISite site) { if (site != null) { return(SiteDto.ConvertFromSite(site)); } return(default(SiteDto)); }
public IList <DataTransfer.SiteDto> GetSites() { IList <SiteDto> siteDtos = new List <SiteDto>(); IList <ISite> sites = _resp.GetSites(); foreach (ISite site in sites) { siteDtos.Add(SiteDto.ConvertFromSite(site)); } return(siteDtos); }
public IList <SiteDto> GetSites() { IList <SiteDto> siteDtos = new List <SiteDto>(); IList <ISite> sites = repo.GetSites(); foreach (ISite site in sites) { siteDtos.Add(SiteDto.ConvertFromSite(site)); } return(siteDtos); }
public SiteDto[] GetUserRelationSites(int userId) { IDictionary <int, AppRolePair> data = this._userRepository.GetUserRoles(userId); int len = data.Keys.Count; SiteDto[] sites = new SiteDto[len]; if (len > 0) { int i = 0; foreach (var key in data.Keys) { sites[i++] = SiteDto.ConvertFromSite(this._siteRepository.GetSiteById(data[key].AppId)); } } return(sites); }