Esempio n. 1
0
        public IHttpActionResult Get(ODataQueryOptions <NURSE_CONSULTATIONEntity> odataQueryOptions)
        {
            Expression <Func <NURSE_CONSULTATIONEntity, bool> > myfilter = null;

            if (odataQueryOptions.Filter != null)
            {
                myfilter = odataQueryOptions.Filter.ToExpression <NURSE_CONSULTATIONEntity>();
            }
            try
            {
                NURSE_CONSULTATIONService service = new NURSE_CONSULTATIONService();
                var expression = LinqExtensions.True <NURSE_CONSULTATIONEntity>();
                if (myfilter != null)
                {
                    expression = expression.And(myfilter);
                }
                var query = service.IQueryRecord(expression).ToList();
                return(Ok(query.AsQueryable()));
            }
            catch (Exception)
            {
                return(NotFound());
            }
        }