Is there a 'official' or 'better' way to implement a .Net C# MVC project using Entity Framework with Database First, Multi-Tie architetire and Role-Based security?
I did some MVC projects using Entity Framework with Database First. Because the projects are relative simple, so whenever need to query, I create the entity in the controller, do the LINQ query directly. Now, if I want to implement multi-tie architeture, does that mean I need to refactor all these, and seperate all query codes into a service layer? even for a very simple query?
As for Role-Based security, oftern time, the UI are different based on the Role. For example, for admin, all buttons should show up. but for regular user, maybe we only want to show 1 button. In this case, I usually use razor syntax in view and check role again in controller. Is this the correct way?
I'm wondering whether there are some sample projects for how to in these cases. I could not find them after some search.
Thanks