Пример #1
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            WebApiConfig.Register(GlobalConfiguration.Configuration);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            RecipeAppContext context = new RecipeAppContext();
            var config = GlobalConfiguration.Configuration;
            config.DependencyResolver = new DbDependencyResolver(context);
        }
 public DbDependencyResolver(RecipeAppContext context)
 {
     this.context = context;
     recipeRepository = new RecipeRepository(context);
     data = new UserDataPersister(context);
 }
 public UserDataPersister(RecipeAppContext entities)
 {
     this.entities = entities;
 }
Пример #4
0
        static void Main(string[] args)
        {
            RecipeAppContext context = new RecipeAppContext();

            var asd = context.Users;
        }