Fixed bug for EF dbcontext with Unity lifetime

Fixed bug for EF dbcontext with Unity lifetime