added foolproofing
This commit is contained in:
parent
cdfb045c90
commit
d846756a7f
1 changed files with 7 additions and 1 deletions
|
@ -22,13 +22,15 @@ namespace BirdsiteLive.DAL.Postgres.DataAccessLayers
|
|||
|
||||
public async Task CreateTwitterUserAsync(string acct, long lastTweetPostedId)
|
||||
{
|
||||
acct = acct.ToLowerInvariant();
|
||||
|
||||
using (var dbConnection = Connection)
|
||||
{
|
||||
dbConnection.Open();
|
||||
|
||||
await dbConnection.ExecuteAsync(
|
||||
$"INSERT INTO {_settings.TwitterUserTableName} (acct,lastTweetPostedId,lastTweetSynchronizedForAllFollowersId) VALUES(@acct,@lastTweetPostedId,@lastTweetSynchronizedForAllFollowersId)",
|
||||
new { acct = acct, lastTweetPostedId = lastTweetPostedId, lastTweetSynchronizedForAllFollowersId = lastTweetPostedId });
|
||||
new { acct, lastTweetPostedId, lastTweetSynchronizedForAllFollowersId = lastTweetPostedId });
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -36,6 +38,8 @@ namespace BirdsiteLive.DAL.Postgres.DataAccessLayers
|
|||
{
|
||||
var query = $"SELECT * FROM {_settings.TwitterUserTableName} WHERE acct = @acct";
|
||||
|
||||
acct = acct.ToLowerInvariant();
|
||||
|
||||
using (var dbConnection = Connection)
|
||||
{
|
||||
dbConnection.Open();
|
||||
|
@ -78,6 +82,8 @@ namespace BirdsiteLive.DAL.Postgres.DataAccessLayers
|
|||
{
|
||||
if (acct == default) throw new ArgumentException("acct");
|
||||
|
||||
acct = acct.ToLowerInvariant();
|
||||
|
||||
var query = $"DELETE FROM {_settings.TwitterUserTableName} WHERE acct = @acct";
|
||||
|
||||
using (var dbConnection = Connection)
|
||||
|
|
Reference in a new issue