Beispiel #1
0
        // GET api/template
        public List <T> Get()
        {
            DbQuery <T> query  = context.Set <T>();
            string      expand = HttpContext.Current.Request.QueryString["expand"];

            if (expand != null)
            {
                string[] properties = expand.Split(',');
                if (properties.Length != 0)
                {
                    foreach (var property in properties)
                    {
                        query = query.Include(property);
                    }
                }
            }
            return(query.ToList());
        }