Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Yasin Aydin
EFCoreDemo2018Fall
Commits
bf8601c1
Commit
bf8601c1
authored
Nov 09, 2018
by
Andres Käver
Browse files
indexes
parent
6023333a
Changes
1
Hide whitespace changes
Inline
Side-by-side
DAL/AppDbContext.cs
View file @
bf8601c1
...
...
@@ -40,6 +40,15 @@ namespace DAL
modelBuilder
.
Entity
<
ContactType
>()
.
HasIndex
(
i
=>
i
.
ContactTypeValue
).
IsUnique
();
modelBuilder
.
Entity
<
Person
>()
.
HasIndex
(
p
=>
p
.
FirstName
);
modelBuilder
.
Entity
<
Person
>()
.
HasIndex
(
p
=>
p
.
LastName
);
modelBuilder
.
Entity
<
Person
>()
.
HasIndex
(
p
=>
new
{
p
.
FirstName
,
p
.
LastName
}).
IsUnique
();
// remove Cascade delete from all the entities <- this has to be at the end
foreach
(
var
mutableForeignKey
in
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment