コード例 #1
0
        public IHttpActionResult Get(ODataQueryOptions <Uom> queryOptions)
        {
            logger.Trace("Call UomController Get All");

            try
            {
                queryOptions.Validate(_validationSettings);
            }
            catch (ODataException ex)
            {
                return(BadRequest(ex.Message));
            }

            var data = uomRepository.GetAll();

            var query = (IQueryable <Uom>)queryOptions
                        .ApplyTo(data.AsQueryable());

            return(Ok(query));
        }
コード例 #2
0
 public IEnumerable <Uom> GetAll()
 {
     return(_uomRepository.GetAll());
 }