public IHttpActionResult Get(ODataQueryOptions <ContactDetail> queryOptions)
        {
            logger.Trace("Call ContactDetailsController Get All");

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

            var data = ContactDetailRepository.GetAll();

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

            return(Ok(query));
        }
示例#2
0
 public IEnumerable <ContactDetail> GetAll()
 {
     return(_contactDetailRepository.GetAll());
 }