コード例 #1
0
 public IQueryable <SiteADEntity> QuerySiteADs(QuerySiteADsParameter param)
 {
     using (var context = new InfrastructureServiceEntities())
     {
         int status = EnumToValue(StatusKind.Blocked);
         var q      = from t in context.SiteADs
                      where t.AppID == param.AppID &&
                      (param.SkipStatus || t.Status != status) &&
                      (param.RowID == null || t.RowID == param.RowID)
                      orderby t.Sort ascending
                      select new SiteADEntity
         {
             AppID        = t.AppID,
             RowID        = t.RowID,
             BeginDate    = t.BeginDate,
             EndDate      = t.EndDate,
             FileKey      = t.FileKey,
             Name         = t.Name,
             RenderHeight = t.RenderHeight,
             RenderWidth  = t.RenderWidth,
             Sort         = t.Sort,
             Status       = (StatusKind)t.Status,
             Url          = t.Url
         };
         return(q);
     }
 }
コード例 #2
0
        public QuerySiteADsResult QuerySiteADs(QuerySiteADsParameter param)
        {
            var result     = new QuerySiteADsResult();
            var repository = new SiteRepository();

            result.PageResult(repository.QuerySiteADs(param), param);
            return(result);
        }