Exemplo n.º 1
0
 // GET: api/News
 public List<NewsResponse> Get()
 {
     List<NewsResponse> list = new List<NewsResponse>();
     foreach (News news in db.News)
     {
         NewsResponse newsresponse = new NewsResponse(news);
         list.Add(newsresponse);
     }
     return list;
 }
Exemplo n.º 2
0
 // GET: api/News/5
 public List<NewsResponse> Get(string id)
 {
     Company company = db.Companies.Where(c => c.GUID == id).FirstOrDefault();
     List<NewsResponse> list = new List<NewsResponse>();
     foreach (News news in db.News)
     {
         if (company.CompanyType.News_CompanyType.Any(n => n.Id == news.Id) || company.CompanySize.News_CompanySize.Any(m => m.Id == news.Id))
         {
             NewsResponse newsresponse = new NewsResponse(news);
             list.Add(newsresponse);
         }
     }
     return list;
 }