I want to dispose EF context on PageModel(razor page) but PageModel class does not have Dispose method like Controller ?
            Asked
            
        
        
            Active
            
        
            Viewed 490 times
        
    0
            
            
        
        beta
        
- 1
 - 1
 
- 
                    2Why do you want to dispose the EF context? Normally this is handled by the dependecy injection system. How do you retrive the context? – Steve May 01 '21 at 17:20
 - 
                    I got it, no need then – beta May 01 '21 at 17:28
 - 
                    This is a good read: https://stackoverflow.com/questions/38138100/addtransient-addscoped-and-addsingleton-services-differences – Steve May 01 '21 at 17:40