Beispiel #1
0
 public async Task RemoveAuthor(string downloadid, string userid)
 {
     if ((await _downloadTable.SelectById(downloadid)).Any())
     {
         if ((await _userTable.SelectById(userid)).Any())
         {
             DownloadAuthorModel author = new DownloadAuthorModel {
                 DownloadId = downloadid, UserId = userid
             };
             await _downloadAuthorTable.Delete(author);
         }
         else
         {
             throw new ArgumentException("No user with the provided ID could be found.");
         }
     }
 }
Beispiel #2
0
        public async Task Delete(DownloadAuthorModel author)
        {
            string sql = "DELETE FROM `downloadauthors` WHERE `DownloadId` = @DownloadId AND `UserId` = @UserId";

            await _sqlDataAccess.SaveData(sql, author);
        }
Beispiel #3
0
        public async Task Insert(DownloadAuthorModel author)
        {
            string sql = "INSERT INTO `downloadauthors` (DownloadId, UserId) VALUES (@DownloadId, @UserId)";

            await _sqlDataAccess.SaveData(sql, author);
        }