Cody C
Cody C

Reputation: 4807

LinqToSql - change table name attribue at runtime?

When you create a model using LinqToSql, the designer puts an attribute for each table class that looks like

[Table(Name=@"dbo.Project")]

At design time this is easy to change either manually or using T4 templates.

Can this table attribute be changed at runtime?

Upvotes: 1

Views: 245

Answers (1)

Darin Dimitrov
Darin Dimitrov

Reputation: 1039418

Attributes are baked into the metadata of the class at compile time and I doubt it is possible changing their values at runtime. By the way that's one of the reasons why attribute values should always be constant expressions.

Upvotes: 1

Related Questions