Reputation: 5761
I'm trying to pass some parameters into a data annotation, and it is rejecting my named parameter. See below:
It's the same exact syntax in Microsoft's documentation for the TableAttribute, except in the documentation they have an uppercase N, but intellisense on the parameter in VS asks for a lower case n.
Edit: After getting 2 good answers, I just wanted to explain why I thought I could do this in the first place. It looks like the constructor was updated, but the tooltip wasn't, because this is what shows up when you get the syntax prompt:
And I needed to be able to specify schema. But now I've found another way to do this.
Edit #2: Why I was trying named parameters in the first place; because this wasn't working.
Edit #3: Apparently I missed trying this syntax, which works. Figured it out thanks to Damien.
Upvotes: 2
Views: 923
Reputation: 239764
You're looking at the wrong TableAttribute
. The one from the DataAnnotations
namespace expects a constructor (non-named) name
parameter.
Upvotes: 4
Reputation: 4059
Name isn't an optional parameter for TableAttribute
. You don't need to prefix it with name:=
at all. Just type as:
<Table("SYSTEMSETTING")>
Public Class MyTableClass
Upvotes: 1