task

mvc app1 => guide asp.net mvc

[WHAT]

  1. ] asp.net mvc demo app
  2. ]

[WHY]

  1. ] learn/teach the msft asp.net mvc framework
  2. ] resources
  3. ] tutorials

[WHERE]

  1. ] aspnet-MVC.sospep.com -

[WHEN]

  1. ] 2015-07-dd

[EXAMPLE]

[HOW-TO]

  1. ]

[REFERENCE]

  1. ] SUMMARY-VIDEO-COURSE intro-to-mvc - SRC=a mva course Jon Galloway, Christopher Harrison
  2. ] SUMMARY-ARTICLE-SERIES migrating from web pages to mvc - a 3 part series - SRC=mikesdotnetting.com, mike Brind
  3. ] SUMMARY-ARTICLE-SERIES getting-started-with-MVC -SRC=asp.net, Rick Anderson
  4. ] SUMMARY-VIDEO-COURSE # 5373 - Entity Framework -
  5. ]

developer implementation

[process]

  1. [] building your first asp.net MVC app - in (8) steps
    1. x] > vs studio installed
    2. x] > create your first project
    3. ] DATA-1 - connect to an existing db
    4. ] DATA-2 - create a new db using EF ( code first )  
    5. ] DATA-3 - use an existing db with EF ( db first ) 
    6. ] testing - unit, operational
    7. ] deploying -
    8. ] next == /test deployment, /iteration, /
  2. [] LIST sample demo 1
    1. ] new project -
    2. ] add model -
    3. ] add controller -  
    4. ] add view -
    5. ]
  3. [demo 2]
    1. ] get data from db
    2. ] display data from db

[notes]

  1. ] have Y
  2. [] DESIGN my app  (guide mvc.*)
    1. > IPO =  x] Home, x] Questions, ] Lessons, ] Resources, x] About, x] Contact
  3. QUIZ app
    1. ] questionsController
    2. ] questionsModel
    3. ] questionsView
    4. ] answers
    5. ] users
    6. ] scores-results
  4. VIEWS -
    1. ] list quizzes[]
    2. ] display list-questions(quiz)
    3. ] submit-question-answers <- display list-questions(quiz)
    4. ] check-answers
  5. [your DATA decision]
    1. ] 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  
    2. ] OPTION 1 - using an existing DB - commando - aka getting data out of and putting it back into an existing SQL database.  
    3. ] OPTION 2 - using an existing DB wih EF db first -
    4. ] OPTION 3 - creating a new DB for the project using EF code first -
  6. ] guideMVC ( gig13), CONTENTS
    1. ] summ introMVCseries, ] summ entityFramework series ] other (rick anderson art, m brind art migrating )
    2. ] app guideMVC - ] q+a interview, quiz ] lessons / tutorials ] resources  
    3. ] 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]

  1. ] SUMMARY
    1. ] v-001 -
    2. ] v-002 -

status

[previously]

  1. [PLAN] build an example/sample/demo app
    1. ] # # ADD page - Questions
    2. +] project -
  2. [2015-mm-dd][00:00] build new project using MVC template
    1. ] # # -
    2. *] had existing MVC1 project, I used that, think it uses an older version of the MVC template
  3. [00:00] NEW task
    1. x] # # - UPDATE about page - add my about info
    2. x] replace "example content data" on "about" page by editing "about" view in directory /views/home
  4. [00:00] NEW task
    1. x] replace "example content data" on "contact" page by editing "contact" view
    2. x] # # - UPDATE contact page - add my contact details
  5. [00:00] NEW task
    1. x] # # TEST - register user function = PASS, added user: tester pw: password
  6. [00:00] NEW task IN
    1. x] UPDATE layout page - add menu option for Questions page
  7. [00:00] NEW task IN
    1. x] UPDATE add - to siteLayout - menu item for "questions"
  8. ] NEW task IN
    1. ] CREATE add "model" - class = questions
  9. ] NEW task IN
    1. ] CREATE add "model"  - class = answers
  10. [00:00] NEW task IN
    1. x] UPD add to homeController - method "questions" for return questions view
  11. [00:00] NEW task IN
    1. x] CREATEd -  view - questions IN /views/home directory
  12. [2015-07-12][00:00] NEW task IN
    1. ] TRY add controller - using scaffolding - to generate Controller and Views ( based upon given Model )
  13. [00:00] NEW task IN
    1. ] added controller - questions - using "scaffolding"
    2. ] UPD - questions class to add dbcontext
  14. [00:00] NEW task IN - EF - create db using
    1. x] # # - generate a database - using ef
    2. *] some notes ON "adding connection string to web.config," also says you dont have to
    3. x] SRC=tutorial Rick A. # 1 -
  15. [00:00] NEW task IN
    1. x] # # - ADDed the model class(Movies)
    2. x] copy and paste class from tutorial into new class file
    3. x] BUILD ( otherwise next step will throw error ... )
  16. [00:00] NEW task IN
    1. 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
    2. * ] 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
    3. *] 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
    4. ?] BUT - still dont see any kind of db (*.mdf file) in the AppData directory
    5. x] ACTUALLY - it (the db) was there, YOU NEED TO click the "Show all files" button on the "Solutions Explorer" window menu
  17. [00:00] NEW task IN
    1. x] # # - TRY - build question.cs AS PER movies.cs
    2. x] model - add 2nd db context class to the existing questions class,
    3. x] BUILD pass
  18. [00:00] NEW task IN
    1. 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
    2. x] http://stackoverflow.com/questions/10540198/context-menu-to-add-controller-view-missing 
    3. x] PRB - ERROR - about no key defined in Answer, questions class contains a list of Answers, REM out line
    4. x] BUILD =pass,
    5. x] TEST = pass
  19. [00:00] NEW task IN
    1. 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,
    2. x] removed the original Questions.cs from the project, * file still exists in phyical directory
  20. [2015-07-17][00:00] NEW task IN
    1. i] # # RENAME sln - FROM: default:MVCapplication1 TO: guide-MVC
    2. x] use find and replace to replace all occurences,(##), manually walk through each replacement
    3. x] there is a lot of occurences
  21. [00:00] PRB - 33 errors ( apparently: hyphen/dash doesnt work as a name for namespace OR ???
    1. x] renamed FROM: guide-MVC, TO: guideMVC
    2. x] use find + replace (43 occureneces)
    3. x] TEST = build
  22. [00:00] PRB - missing data (prev ) from questions doesnt seem to be there
    1. x] TRY - add some more data - see what happens, data adds OK, displays OK, where is it stored ? ( no NEW dbs added )
    2. x] TRY - RENAMED "aspnet-MvcApplication1-2013-nnnnnnn" AS guideMVC.Models.Questions ( as per dbContext naming format)
    3. x] TEST = build, PASS
  23. [00:00] NEW task
    1. x] # # - DATA-decision - OPTIONS ] exisiting db(mysql) direct ] new db() using EF (code first), ] existing db()  
  24. [00:00] NEW task
    1. 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  
  25. [00:00] NEW task
    1. i] FIX-PRB-5380 - no bootstrap
  26. [2015-07-18] UPDATE task
    1. x] FIX-PRB-5380 - no bootstrap
    2. ] redesign EXISTING pages for bootstrap - including ] menu ]

 

[currently]

  1. ] passing data from the model into the view
  2. ] accessing data from the model in the view

[next]

  1. ] ADD - Resource - tutorial
    1. ] http://www.dotnetcurry.com/aspnet-mvc/1124/aspnet-mvc-bootstrap - builds app
  2. ] ADD - Resourse - course
    1. ] udemy SRC=art on using with mysql on codeproject

 

 

 


  1. > + "using nameSpace.Models.{model}" to get access to models in the controller ( HomeController ), my ex creates new instance of Question object
  2. > + "@model nameSpace" TO: /views/{viewName}
  3. > use "@Model.{property} - TO: WHY: access the property values of the model passed into the view
  4. >
  5. > use EF seed function - to "new up" a bunch of data || controller new Question q
  6. >

  

- ] 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

 

 

 

 

 

 

 

Details Photos Edit more

Details

ID: 5050

NAME: guide-asp.net-MVC

DESCRIPTION: 5050 - learning the msft asp.net MVC framework for developing web applications.

START DATE TIME: 2015-04-17 06:00:00

EST DURATION: 00:45:00

END DATE TIME: 2015-04-17 06:45:00

STATUS: In-Process

PRIORITY: -5

OWNER ID: 75

Content Photos Edit more

photos

photos for this task

actions

Agenda Email task SMS task Priorities