Last post Dec 28, 2019 06:56 PM by deepalgorithm
Dec 28, 2019 06:43 PM|qwertz|LINK
Is it considered good practice to send information about currently logged in user from controller to repository? On the other hand, is it better to get information about currently logged user from repository?
Dec 28, 2019 06:56 PM|deepalgorithm|LINK
Best practice is subjective. The correct answer depends on your requirements.
If your repositories require user information to perform CRUD operations - then you should pass user information down the stack.
If you are using
ASP.NET Core Identity, then theoretically user information can be accessed from any layer of your application by using dependency injection.