views:

149

answers:

1

I followed instructions for mvc validation but I can't manage to solve this problem.... This is linq to sql model:
DB Model


I set Entity namespace to be CMS.Model

If I try to declare partial class Article in Portal.Models namespace:

public partial class Article
    {
        ....
    }

Then, after using Article article somewhere in code I get following error:

'Article' is an ambiguous reference between 'Portal.Models.Article' and 'CMS.Model.Article'


Portal is project name and CMS is area.... I followed these instructions I aslo created NerdDinner from scratch and in that example validation works. I can't figure out what am I doing wrong... someone noticed my mistake? Is it related with giving name to Entity namespace (in tutorial they used default one)

Thanks in advance!

PS I'd like to note that I'm c# newbie so I'm not really familiar with these partial classes

+1  A: 

The error you are getting is not related to validation- you are referring to a class called "Article", but you have references to two different "Article" classes.

Update references to the Article class with the fully-qualified name and the error should be resolved.

Dave Swersky