Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Mar 26, 2010 07:36 PM by ricka6
Mar 24, 2009 05:40 PM|LINK
Creating a Movie Database Application with ASP.NET MVC (C#) http://www.asp.net/learn/mvc/tutorial-21-cs.aspx
Error 1 The type or namespace name 'MoviesDBEntities' could not be found (are you missing a using directive or an assembly reference?)
C:\ ... \Controllers\HomeController.cs 13 17 MovieApp
Solution: add using
public class HomeController : Controller
private MoviesDBEntities _db = new MoviesDBEntities();
Mar 24, 2009 05:47 PM|LINK
This was changed for RTM, I sent mail to the author of the tutorial and we will get it updated.
thanks for the catch,
Mar 24, 2009 05:48 PM|LINK
check the name of your entity in your edmx file
Mar 24, 2009 06:02 PM|LINK
@ GillouX ....hi, I am not sure what you are saying ... the solution was to add the
joecar says RTM broke the tutorial ... although I do not understand why/how (joecar
GillouX, could you clarify please and thank you.
Mar 24, 2009 06:09 PM|LINK
I mean the using statement just make avaiable the library under ...Models namespace.
your edmx file is so in the model template
if it's the case; there is no reason it shouldn't work except if your entity doesn't not have the same name but I don't think it's your problem anyway :D
Mar 25, 2009 06:53 AM|LINK
@ joecar ....... Joe, you are welcome. Here's another problem with this tutorial:
Stephen Walther, above Figure 13 claims:
Notice that you get form validation automatically.
If you neglect to enter a release date for a movie, or you enter an invalid release date,
then the form is redisplayed and the release date field is highlighted.
This above claim is misleading.
Id int No Nulls
Title nvarchar(100) No Nulls
Director nvarchar(100) No Nulls
DateReleased datetime No Nulls
Examples of validation that is not automatic:
-- it is possible to enter only a date
-- it is possible to enter duplicate records
Since it is clearly a tutorial and since tutorials are for teaching,
it should assume the person working through the tutorial is not
Stephen Walther. Therefore it should say WHAT kind of automatic
validations are possible, how to enable various kinds of automatic
validations, and how to code standard non-automatic validations
such as director must be non blank and movie title
must be non blank.
The tutorial concludes "I hope that you discovered that building an
ASP.NET MVC web application is very similar to the experience
of building an Active Server Pages or ASP.NET application." It's
not. Building an ASP.NET WebForms with code behind is very
different. The paradigms are different.
Mar 25, 2009 10:50 AM|LINK
I am very much in agreement with you here Gerry.
If Linq to SQL can map your tables and columns so well then surely the MVC platform should be able to tell that a column/property has a NOT NULL attribute.
Therefore if you have a string column that is marked as NOT NULL why do we have to add our own RuleViolation class to check that this property is not empty and not null, this should be built in.
Mar 25, 2009 12:55 PM|LINK
Yes, there are at least two issues here.
(1) the tutorials need to be improved such that
(a) they work and they work as intended by the designers with the
(b) the tutorials also help the learner understand the
boundaries of ASP.NET MVC v1.0.
(2) small and frequent bug free incremental releases precede
ASP.NET MVC v1.0
ASP.NET MVC v1.01 ~~ recognizes NOT NULL column/property;
generates appropriate validation edits automatically
~~ [optionally] prevents duplicate records
Features like the optional prevention of duplicate records could be controlled
via [attribute] usage.
regards ~~ gerry (lowry)
Mar 25, 2009 01:10 PM|LINK
Agreed, however is this a developer led community? Do MS read these forums and add the requests to new releases? Is it worth setting up a new thread with ASP.NET MVC 1.01 requests
One other issue I have is with ValidationMessage, there should be an overload method that allows option of message appearing in a ValidationSummary
Mar 25, 2009 01:28 PM|LINK
Yes, Microsoft has people assigned to these forums AFAIK.
I also imagine that the ASP.NET MVC team members also lurk here too.
Microsoft people examples: joecar,
ricka6, levib, and jeloff are
ASP.NET team members.
I've seen occasional postings by Phil Haack and Scott Guthrie too.
There are also MVPs who likely are an audience that has access to Microsoft's "ear".