diff --git a/Models/Item.cs b/Models/Item.cs index 23ecb63..2726273 100644 --- a/Models/Item.cs +++ b/Models/Item.cs @@ -11,7 +11,6 @@ namespace BuecherwurmAPI.Models } public class ItemPost { - [Required] public int BookId { get; set; } } diff --git a/Models/ItemModel.cs b/Models/ItemModel.cs index 37017b0..f2ef1b1 100644 --- a/Models/ItemModel.cs +++ b/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