public static IList <AdsInfo> GetCacheAdsByPlaceID(int intPlaceID) { IEnumerable <AdsInfo> enumerable = from p in Ads.GetCacheAds() where p.BeginDate <= DateTime.Now && p.EndDate >= DateTime.Now && p.IsAudit && p.PlaceID.Equals(intPlaceID) select p; IList <AdsInfo> result; if (enumerable != null) { result = enumerable.ToList <AdsInfo>(); } else { result = null; } return(result); }
public static AdsInfo GetCacheAdByID(int intAdID) { return((from p in Ads.GetCacheAds() where p.AutoID.Equals(intAdID) select p).FirstOrDefault <AdsInfo>()); }