Пример #1
0
        public static void Register(HttpConfiguration config)
        {
            //config.Formatters.Remove(config.Formatters.XmlFormatter);

            Microsoft.Data.Edm.IEdmModel model = GetEdmModel();
            config.Routes.MapODataRoute("ODataRoute", "odata", model);
        }
Пример #2
0
        private IEdmEntityContainer GetDefaultEntityContainer(Microsoft.Data.Edm.IEdmModel model)
        {
            IEnumerable <IEdmEntityContainer> containers = model.EntityContainers().ToList();

            foreach (IEdmEntityContainer container in containers)
            {
                if (model.IsDefaultEntityContainer(container))
                {
                    return(container);
                }
            }

            return(null);
        }