Skip to content

Commit aa636ad

Browse files
committed
Issue_21: Added SqliteForeignKeyIndexConvention.
1 parent fb8f6f7 commit aa636ad

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using System;
2+
using System.Data.Entity.Core.Metadata.Edm;
3+
using System.Data.Entity.Infrastructure;
4+
using System.Data.Entity.ModelConfiguration.Conventions;
5+
6+
namespace SQLite.CodeFirst.Convention
7+
{
8+
public class SqliteForeignKeyIndexConvention : IStoreModelConvention<AssociationType>
9+
{
10+
public virtual void Apply(AssociationType item, DbModel model)
11+
{
12+
if (item == null)
13+
{
14+
throw new ArgumentNullException("item");
15+
}
16+
if (model == null)
17+
{
18+
throw new ArgumentNullException("model");
19+
}
20+
if (item.Constraint == null)
21+
{
22+
return;
23+
}
24+
}
25+
}
26+
}

SQLite.CodeFirst/SQLite.CodeFirst.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
<Compile Include="Builder\ForeignKeyStatementBuilder.cs" />
7878
<Compile Include="Builder\CreateDatabaseStatementBuilder.cs" />
7979
<Compile Include="Builder\PrimaryKeyStatementBuilder.cs" />
80+
<Compile Include="Convention\SqliteForeignKeyIndexConvention.cs" />
8081
<Compile Include="Extensions\EntityTypeExtension.cs" />
8182
<Compile Include="SqliteCreateDatabaseIfNotExists.cs" />
8283
<Compile Include="SqliteDropCreateDatabaseAlways.cs" />

0 commit comments

Comments
 (0)