懒得勤快 6 years ago
parent
commit
8787a0baa9
1 changed files with 2 additions and 0 deletions
  1. 2 0
      Masuit.LuceneEFCore.SearchEngine/LuceneIndexableBaseEntity.cs

+ 2 - 0
Masuit.LuceneEFCore.SearchEngine/LuceneIndexableBaseEntity.cs

@@ -20,9 +20,11 @@ namespace Masuit.LuceneEFCore.SearchEngine
         /// </summary>
         [LuceneIndex(Name = "Id", Store = Field.Store.YES, Index = Field.Index.NOT_ANALYZED), Key]
 #if Int
+        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
         public int Id { get; set; }
 #endif
 #if Long
+        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
         public long Id { get; set; } 
 #endif
 #if String