Quantcast
Channel: C1 CMS Foundation - Open Source on .NET
Viewing all articles
Browse latest Browse all 2540

New Post: How to query form xml data using odata

$
0
0
The example works but I don't know how to reference my form. I created a datatype called "program". The namespace is ch7.program the form has 4 string fields in it. How to I change this code to reference my form data?

-thanks in advance for any help.



using System.Linq;
using System.Web.Http;
using System.Web.Http.OData.Query;
using Composite.Data;
using Composite.Data.Types;

namespace Composite.Controllers
{
public class PagesController : ApiController
{
    [Queryable]
    public IQueryable<IPage> Get(ODataQueryOptions<IPage> options)
    {
        using (var c = new DataConnection())
        { 
            var querySettings = new ODataQuerySettings();

            return options.ApplyTo(c.Get<IPage>(), querySettings).Cast<IPage>().ToList().AsQueryable();
       }
    }
}
}

Viewing all articles
Browse latest Browse all 2540

Trending Articles