protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (context != null)
         {
             context.Dispose();
             context = null;
         }
     }
 }
Example #2
0
        private static void Configuration(IAppBuilder builder)
        {
            IEdmModel model;
            using (CustomersContext context = new CustomersContext())
            {
                model = context.GetEdmModel();
            }

            HttpConfiguration configuration = new HttpConfiguration();
            configuration.Routes.MapODataRoute("odata", "odata", model);

            builder.UseWebApi(configuration);
        }