I come from 5 years of experience with ASP.NET Web Forms and I am new to ASP.NET MVC. Now I am trying to learn MVC with some tutorials, video tutorials and books.
I use Visual Studio 2012 and the new ASP.NET MVC 4 to create a small web application to manage my mutual fund portfolio. This should allow me to enter a new pattern and learn a lot ...
My app should also let some other friends do the same. Thus, he must manage the portfolios of different users .
I created a small database with Entity Framework Code First, so I have several basic models: Fund, Portfolio, Share, Deposit, Source and User. One user can have many portfolios with many funds inside them. Each user has their own list of contributions. Each fund has many shares (one / day).
The source model is just a table where I put one URL for each website source for stock data for a particular fund. Thus, one fund has many sources. Then I use the scraper class to retrieve data from these sites once a day.
This is the basic structure of the application. Now I need to know what would be best:
1) User account management .
Should I integrate the ASP.NET membership database structure into my database and use it instead of my user table for user management?
2) User content management : portfolios, funds, etc.
What is the easiest and most elegant way in an MVC template to implement authentication and all authorization checks to get the user to get their own data? Do I need to check this inside every action on every controller?
So, in other words, how do I implement my controllers? For instance:.
[Authorize] public class PortfolioController : Controller { private FundMonitorContext db = new FundMonitorContext(); public ActionResult Index() {
I would be very grateful for every suggestion!
source share