Browse Source

review

David
nek0 2 years ago
parent
commit
de7bc0871d
  1. 1
      Models/Item.cs
  2. 3
      Models/ItemModel.cs

1
Models/Item.cs

@ -11,7 +11,6 @@ namespace BuecherwurmAPI.Models
}
public class ItemPost
{
[Required]
public int BookId { get; set; }
}

3
Models/ItemModel.cs

@ -98,8 +98,7 @@ namespace BuecherwurmAPI.Models
command.Parameters.Add(new SqliteParameter("@bookId", itemPost.BookId));
command.ExecuteNonQuery();
command.CommandText = "select last_insert_rowid()";
Int64 LastRowId64 = (Int64)command.ExecuteScalar();
long LastRowId = (long)LastRowId64;
var LastRowId64 = (long)command.ExecuteScalar();
var item = new Item{
ItemId = LastRowId64,
BookId = itemPost.BookId

Loading…
Cancel
Save