Sasha
Sasha

Reputation: 1978

OneToOne relation (cardinality) in LINQ to SQL with SQLMetal

Is there any possibility to set OneToOne relation (cardinality) when generate dbml with SQLMetal? By default dbml schema generated with the OneToMany relation.

Upvotes: 2

Views: 1541

Answers (2)

Carl Hörberg
Carl Hörberg

Reputation: 6005

I use SqlMetal to produce a Dbml file, and then i use a xslt to modify the content of it(using this xslt base: http://blogs.msdn.com/ploeh/archive/2008/04/10/AutomaticallyGeneratingLINQToSQLModelsFromTSQL.aspx), eg. changing the cardinality or changes the type for Enums.

Upvotes: 0

Richard Ev
Richard Ev

Reputation: 54127

Are you using the DBML designer? If so you should be able to right-click the arrow that represents the relationship and select Properties. The Cardinality property can then be set in the properties dialog to OneToOne.

Upvotes: 2

Related Questions