Skip to content

Commit 2bf0121

Browse files
author
Marc Sallin
committed
#27: Added sample code and updated readme.
1 parent e4845b4 commit 2bf0121

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Currently the following is supported:
2222
- Not Null constraint
2323
- Auto increment (An int PrimaryKey will automatically be incremented)
2424
- Index (Decorate columns with the `Index` attribute. Indices are automatically created for foreign keys by default. To prevent this you can remove the convetion `ForeignKeyIndexConvention`)
25+
- Unique constraint (Decorate columsn with the `UniqueAttribute` which is part of this library)
2526

2627
I tried to write the code in a extensible way.
2728
The logic is divided into two main parts, Builder and Statement.

SQLite.CodeFirst.Console/Entity/Player.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ namespace SQLite.CodeFirst.Console.Entity
66
public class Player : Person
77
{
88
[Index] // Automatically named 'IX_TeamPlayer_Number'
9+
[Unique(OnConflictAction.Fail)]
910
public int Number { get; set; }
1011

1112
public virtual Team Team { get; set; }

0 commit comments

Comments
 (0)