Where are models added?

404 Views Asked by At

(My apologies for all those that voted the question down. I'm not trying to avoid researching. I've been actually trying to find a way for doing this for the past several hours. The only thing I'm trying to avoid is paying the Umbraco TV membership fee)

This is probably a dumb question:

I'm somewhat familiar with MVC, but really new to UMBRACO 7. I'm going through documentation on how to add restricted pages (pages accesible to some membership types) and I have to create a model. I've been searching through the whole UMBRACO settings and developer back office pages but couldn't find where to add the models. Neither was I able to find in VS where to add them (which would be even more convenient).

Can someone point me in the right direction or any documentation where I would be able to understand how Umbraco and MVC+VS work together and add models and custom code to an UMBRACO 7 website?

(I have the site running locally in VS2013 and DB in MSSQL Server 2014)

THANK YOU KINDLY!

2

There are 2 best solutions below

0
Scherling On

I would recommend you read up on Umbraco surface controllers. You can learn a bit about what it is and how it works here: http://our.umbraco.org/documentation/Reference/Mvc/surface-controllers

To answer your question, you put your models where you always put model classes in MVC: Pretty much where ever you like in the solution. However, it would be pretty good idea to put it in a folder & namespace called Models.

1
bowserm On

When I want to restrict access to pages in my umbraco site, I usually find that I can use the default "Public Access" that umbraco has set up. Just right click on a node in the content tree, and you should be able to restrict access to either specific members or a specific member groups.

https://our.umbraco.org/wiki/reference/umbraco-client/context-menus/public-access