mvc app1 => guide asp.net mvc
[WHAT]
- ] asp.net mvc demo app
- ]
[WHY]
- ] learn/teach the msft asp.net mvc framework
- ] resources
- ] tutorials
[WHERE]
- ] aspnet-MVC.sospep.com -
[WHEN]
- ] 2015-07-dd
[EXAMPLE]
- ]
[HOW-TO]
- ]
[REFERENCE]
- ] SUMMARY-VIDEO-COURSE intro-to-mvc - SRC=a mva course Jon Galloway, Christopher Harrison
- ] SUMMARY-ARTICLE-SERIES migrating from web pages to mvc - a 3 part series - SRC=mikesdotnetting.com, mike Brind
- ] SUMMARY-ARTICLE-SERIES getting-started-with-MVC -SRC=asp.net, Rick Anderson
- ] SUMMARY-VIDEO-COURSE # 5373 - Entity Framework -
- ]
developer implementation
[process]
- [] building your first asp.net MVC app - in (8) steps
- x] > vs studio installed
- x] > create your first project
- ] DATA-1 - connect to an existing db
- ] DATA-2 - create a new db using EF ( code first )
- ] DATA-3 - use an existing db with EF ( db first )
- ] testing - unit, operational
- ] deploying -
- ] next == /test deployment, /iteration, /
- [] LIST sample demo 1
- ] new project -
- ] add model -
- ] add controller -
- ] add view -
- ]
- [demo 2]
- ] get data from db
- ] display data from db
[notes]
- ] have Y
- [] DESIGN my app (guide mvc.*)
- > IPO = x] Home, x] Questions, ] Lessons, ] Resources, x] About, x] Contact
- QUIZ app
- ] questionsController
- ] questionsModel
- ] questionsView
- ] answers
- ] users
- ] scores-results
- VIEWS -
- ] list quizzes[]
- ] display list-questions(quiz)
- ] submit-question-answers <- display list-questions(quiz)
- ] check-answers
- [your DATA decision]
- ] chances are your going to be working with some form of data and the need to persist(store) that data. There are a couple of main DATA scenarios to consider
- ] OPTION 1 - using an existing DB - commando - aka getting data out of and putting it back into an existing SQL database.
- ] OPTION 2 - using an existing DB wih EF db first -
- ] OPTION 3 - creating a new DB for the project using EF code first -
- ] guideMVC ( gig13), CONTENTS
- ] summ introMVCseries, ] summ entityFramework series ] other (rick anderson art, m brind art migrating )
- ] app guideMVC - ] q+a interview, quiz ] lessons / tutorials ] resources
- ] lessons - ] add controllers, ] add model, ] add view ] routes ( controller/action/parameter) ] getting the model data into controller ] passing the model data to the view ] accessing the model data in the view, ] my model ( question, answer )
[by_date]
- ] SUMMARY
- ] v-001 -
- ] v-002 -
status
[previously]
- [PLAN] build an example/sample/demo app
- ] # # ADD page - Questions
- +] project -
- [2015-mm-dd][00:00] build new project using MVC template
- ] # # -
- *] had existing MVC1 project, I used that, think it uses an older version of the MVC template
- [00:00] NEW task
- x] # # - UPDATE about page - add my about info
- x] replace "example content data" on "about" page by editing "about" view in directory /views/home
- [00:00] NEW task
- x] replace "example content data" on "contact" page by editing "contact" view
- x] # # - UPDATE contact page - add my contact details
- [00:00] NEW task
- x] # # TEST - register user function = PASS, added user: tester pw: password
- [00:00] NEW task IN
- x] UPDATE layout page - add menu option for Questions page
- [00:00] NEW task IN
- x] UPDATE add - to siteLayout - menu item for "questions"
- ] NEW task IN
- ] CREATE add "model" - class = questions
- ] NEW task IN
- ] CREATE add "model" - class = answers
- [00:00] NEW task IN
- x] UPD add to homeController - method "questions" for return questions view
- [00:00] NEW task IN
- x] CREATEd - view - questions IN /views/home directory
- [2015-07-12][00:00] NEW task IN
- ] TRY add controller - using scaffolding - to generate Controller and Views ( based upon given Model )
- [00:00] NEW task IN
- ] added controller - questions - using "scaffolding"
- ] UPD - questions class to add dbcontext
- [00:00] NEW task IN - EF - create db using
- x] # # - generate a database - using ef
- *] some notes ON "adding connection string to web.config," also says you dont have to
- x] SRC=tutorial Rick A. # 1 -
- [00:00] NEW task IN
- x] # # - ADDed the model class(Movies)
- x] copy and paste class from tutorial into new class file
- x] BUILD ( otherwise next step will throw error ... )
- [00:00] NEW task IN
- x] # # - ADDed a controller (using scaffolding) for Movies - x] right click - add controller , x] choose controller type = mvc with read/write and EF, x] choose model = movie, x] choose dbContextClass =contextMovies
- * ] SWEET - essentially you just create the model file, this one has 2 classes(movie + movieDBcontext), and everything else(controller, views) was auto generated with the scaffolding
- *] RESULT - browse to /movies - has index file, no content, x] Create - add a record PASS, x] Edit record - PASS, ] Delete record - x] Everything tested works fine. TEST Shut down the app. Restart and data is persisted
- ?] BUT - still dont see any kind of db (*.mdf file) in the AppData directory
- x] ACTUALLY - it (the db) was there, YOU NEED TO click the "Show all files" button on the "Solutions Explorer" window menu
- [00:00] NEW task IN
- x] # # - TRY - build question.cs AS PER movies.cs
- x] model - add 2nd db context class to the existing questions class,
- x] BUILD pass
- [00:00] NEW task IN
- x] # # - add a controller (using scaffolding) for Questions.cs x] NO option to "Add controller" b/c REMEMBER to right click "Controllers" folder, NOT the Model file or Models folder - duhhhh
- x] http://stackoverflow.com/questions/10540198/context-menu-to-add-controller-view-missing
- x] PRB - ERROR - about no key defined in Answer, questions class contains a list of Answers, REM out line
- x] BUILD =pass,
- x] TEST = pass
- [00:00] NEW task IN
- x] # # - UPDATE-PAGE- layout - x] lets point the "Questions" link on the main menu in layout, to the new Questions index page VS the orig. Questions.cs page,
- x] removed the original Questions.cs from the project, * file still exists in phyical directory
- [2015-07-17][00:00] NEW task IN
- i] # # RENAME sln - FROM: default:MVCapplication1 TO: guide-MVC
- x] use find and replace to replace all occurences,(##), manually walk through each replacement
- x] there is a lot of occurences
- [00:00] PRB - 33 errors ( apparently: hyphen/dash doesnt work as a name for namespace OR ???
- x] renamed FROM: guide-MVC, TO: guideMVC
- x] use find + replace (43 occureneces)
- x] TEST = build
- [00:00] PRB - missing data (prev ) from questions doesnt seem to be there
- x] TRY - add some more data - see what happens, data adds OK, displays OK, where is it stored ? ( no NEW dbs added )
- x] TRY - RENAMED "aspnet-MvcApplication1-2013-nnnnnnn" AS guideMVC.Models.Questions ( as per dbContext naming format)
- x] TEST = build, PASS
- [00:00] NEW task
- x] # # - DATA-decision - OPTIONS ] exisiting db(mysql) direct ] new db() using EF (code first), ] existing db()
- [00:00] NEW task
- x] # 5375 - 1] existing db(mysql) - x] ADD connection to mysql db - x] ADD Location model x] ADD Location Controller x] ADD Location View ] TEST = PASS
- [00:00] NEW task
- i] FIX-PRB-5380 - no bootstrap
- [2015-07-18] UPDATE task
- x] FIX-PRB-5380 - no bootstrap
- ] redesign EXISTING pages for bootstrap - including ] menu ]
[currently]
- ] passing data from the model into the view
- ] accessing data from the model in the view
[next]
- ] ADD - Resource - tutorial
- ] http://www.dotnetcurry.com/aspnet-mvc/1124/aspnet-mvc-bootstrap - builds app
- ] ADD - Resourse - course
- ] udemy SRC=art on using with mysql on codeproject
- > + "using nameSpace.Models.{model}" to get access to models in the controller ( HomeController ), my ex creates new instance of Question object
- > + "@model nameSpace" TO: /views/{viewName}
- > use "@Model.{property} - TO: WHY: access the property values of the model passed into the view
- >
- > use EF seed function - to "new up" a bunch of data || controller new Question q
- >
- ] display result
] g q= "guide asp.net mvc"
"guide aspnet mvc"
] alt q (g suggested) = asp.net beginners guide, manual study mvc4 guide
EXAMPLE APP =
- questions - add, - edit, -delete