Example #1
0
            private EntityDataServiceResponse <ChannelCategoryAttribute> GetChannelCategoryAttributes(GetChannelCategoryAttributesDataRequest request)
            {
                PagedResult <ChannelCategoryAttribute> channelCategoryAttributes;

                var query = new SqlPagedQuery(request.QueryResultSettings)
                {
                    From    = ChannelCategoryAttributeViewName,
                    Where   = "HOSTCHANNEL = " + SqlParamChannelId,
                    OrderBy = "HOSTCHANNEL, CATEGORY, KEYNAME"
                };

                using (RecordIdTableType categoryRecordIds = new RecordIdTableType(request.CategoryIds, "CATEGORY"))
                    using (SqlServerDatabaseContext context = new SqlServerDatabaseContext(request))
                    {
                        query.Parameters[SqlParamChannelId]     = request.ChannelId;
                        query.Parameters["@TVP_RECIDTABLETYPE"] = categoryRecordIds;

                        channelCategoryAttributes = context.ReadEntity <ChannelCategoryAttribute>(query);
                    }

                return(new EntityDataServiceResponse <ChannelCategoryAttribute>(channelCategoryAttributes));
            }
 /// <summary>
 /// Initializes a new instance of the <see cref="GetChannelCategoryAttributesProcedure"/> class.
 /// </summary>
 /// <param name="request">The request message.</param>
 public GetChannelCategoryAttributesProcedure(GetChannelCategoryAttributesDataRequest request)
 {
     this.request = request;
 }
            /// <summary>
            /// Gets the channel category attributes.
            /// </summary>
            /// <param name="request">The request message.</param>
            /// <returns>The response message.</returns>
            private static EntityDataServiceResponse <ChannelCategoryAttribute> GetChannelCategoryAttributes(GetChannelCategoryAttributesDataRequest request)
            {
                GetChannelCategoryAttributesProcedure getChannelCategoryAttributesProcedure = new GetChannelCategoryAttributesProcedure(request);

                return(new EntityDataServiceResponse <ChannelCategoryAttribute>(getChannelCategoryAttributesProcedure.Execute()));
            }