review
This commit is contained in:
parent
a8b1761867
commit
de7bc0871d
2 changed files with 1 additions and 3 deletions
|
@ -11,7 +11,6 @@ namespace BuecherwurmAPI.Models
|
||||||
}
|
}
|
||||||
public class ItemPost
|
public class ItemPost
|
||||||
{
|
{
|
||||||
[Required]
|
|
||||||
public int BookId { get; set; }
|
public int BookId { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -98,8 +98,7 @@ namespace BuecherwurmAPI.Models
|
||||||
command.Parameters.Add(new SqliteParameter("@bookId", itemPost.BookId));
|
command.Parameters.Add(new SqliteParameter("@bookId", itemPost.BookId));
|
||||||
command.ExecuteNonQuery();
|
command.ExecuteNonQuery();
|
||||||
command.CommandText = "select last_insert_rowid()";
|
command.CommandText = "select last_insert_rowid()";
|
||||||
Int64 LastRowId64 = (Int64)command.ExecuteScalar();
|
var LastRowId64 = (long)command.ExecuteScalar();
|
||||||
long LastRowId = (long)LastRowId64;
|
|
||||||
var item = new Item{
|
var item = new Item{
|
||||||
ItemId = LastRowId64,
|
ItemId = LastRowId64,
|
||||||
BookId = itemPost.BookId
|
BookId = itemPost.BookId
|
||||||
|
|
Loading…
Reference in a new issue