moved the string update sql statement to a constant with the other procedures in SQLiteProcedures

#56
This commit is contained in:
chris.watts90@outlook.com 2017-03-03 21:48:09 +00:00
parent abf8833ba6
commit 72799981b6
2 changed files with 5 additions and 1 deletions

View File

@ -34,6 +34,10 @@ namespace SQLiteRepository
"update " + nameof(CardUniqueId) + " set " + nameof(CardUniqueId.UserId_FK) + "=? where " + "update " + nameof(CardUniqueId) + " set " + nameof(CardUniqueId.UserId_FK) + "=? where " +
nameof(CardUniqueId.Id) + "=?"; nameof(CardUniqueId.Id) + "=?";
public const string UPDATE_CARD_LAST_USED =
"update " + nameof(CardUniqueId) + " set " + nameof(CardUniqueId.LastUsed) + " = ? where " +
nameof(CardUniqueId.Id) + " = ?";
public const string SEARCH_USER_LIST = public const string SEARCH_USER_LIST =
"SELECT * FROM " + nameof(UserIdentity) + " where(" + nameof(UserIdentity.FirstName) + " Like ? OR " + "SELECT * FROM " + nameof(UserIdentity) + " where(" + nameof(UserIdentity.FirstName) + " Like ? OR " +
nameof(UserIdentity.LastName) + " Like ?)"; nameof(UserIdentity.LastName) + " Like ?)";

View File

@ -546,7 +546,7 @@ namespace SQLiteRepository
private void UpdateIdentifierLastUsed(DateTimeOffset dt, int cardId) private void UpdateIdentifierLastUsed(DateTimeOffset dt, int cardId)
{ {
var res = _connection.ExecuteScalar<CardUniqueId>("update CardUniqueId set LastUsed = ? where Id = ?", var res = _connection.ExecuteScalar<CardUniqueId>(SQLiteProcedures.UPDATE_CARD_LAST_USED,
dt, dt,
cardId); cardId);
} }