Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9030493
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T07:30:17+00:00 2026-06-16T07:30:17+00:00

Created a ASP.Net MVC3 application with DI container and using StructureMap. Everything works in

  • 0

Created a ASP.Net MVC3 application with DI container and using StructureMap.
Everything works in controller method. But how can i do for a global.asax method?

Here I set the dependency resolver , Application_Start of global.ascx

    protected void Application_Start()
    {
    DependencyResolver.SetResolver(new StructureMapDependencyResolver(container));
    LoadApplicationMetaData(?,?,?);
    }

      private void LoadApplicationMetaData(IMetaDataService metaService, ITenantService tenantService, ICacheStorage store)
    {
        store.Add("TenantMeta", tenantService.GetAllTenants());

    }

    public class TenantService : ITenantService
    {
    private readonly ITenantRepository TenantRepsitory;

    public TenantService(ITenantRepository _tenantRepository)
    {
        TenantRepsitory = _tenantRepository;
    }
    }

In the this below line how can i do loosely coupling for a method call.

  **LoadApplicationMetaData(?,?,?); what should be passed** 

Note: TenantService class is expecting ITenantRepository

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T07:30:19+00:00Added an answer on June 16, 2026 at 7:30 am
    DependencyResolver.SetResolver(new StructureMapDependencyResolver(container));
    

    You clearly have a reference to the StructureMap container (your variable container) so just call container.GetInstance<IMetaDataService>() etc.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an existing web application that was created using ASP.NET C#, MVC3 with
I have created a web application using ASP.NET MVC3, and want to display a
I have tried everything, even uninstalling asp.net mvc3, and I can't get HandleError global
I have created a web application using ASP.NET MVC3 in Visual studio (no SQL
I am working on an ASP.NET MVC3 application. In the Views I created a
I am developing an ASP.NET MVC3 application with c# and Razor. I created a
I am working on asp.net MVC3 application and I have created a layout.cshtml which
I've created an ASP.NET MVC 3 application, using httpErrors to handle the displaying of
I have troubles consuming unity container in ASP.NET MVC3 application. I have several project
I created a web application using ASP.Net MVC 3 and EF 4.1, and I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.