Base solution for your next web application
Open Closed

IAbpSession in web.host #8077


User avatar
0
amer_op created

hello , i have a class in the web.host project, and i need to accsess the TenantId in my class , what is the best practice to injecte AbpSession object in the class constructor ?


4 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team

    You can take a look at the abp documentation. https://aspnetboilerplate.com/Pages/Documents/Abp-Session

  • User Avatar
    0
    amer_op created

    maliming thank you.

    but how to inject it ? i mean suppose this ->


    public myclass(IAbpSession _AbpSession) { this.AbpSession = _AbpSession; }


    new myclass(what to do here ?);

    do i have to use IOC manager ? or what ?

  • User Avatar
    0
    maliming created
    Support Team

    Yes, you should use IOC everywhere. For more framework information, please see related documents https://aspnetboilerplate.com/Pages/Documents/Dependency-Injection

  • User Avatar
    0
    ismcagdas created
    Support Team

    This issue is closed because it has not had recent activity for a long time.