Esempio n. 1
0
        public async Task <UserPostSave> UserSavePost(Guid userId, Guid postId)
        {
            if (postId == Guid.Empty)
            {
                throw new ArgumentNullException(nameof(postId));
            }
            if (userId == Guid.Empty)
            {
                throw new ArgumentNullException(nameof(userId));
            }

            var userPostSave = new UserPostSave
            {
                PostId = postId,
                UserId = userId,
            };
            await _context.AddRangeAsync(userPostSave).ConfigureAwait(false);

            return(userPostSave);
        }
Esempio n. 2
0
 public void UserUnlikeAPost(UserPostSave currentUserPostSave)
 {
     _context.Remove(currentUserPostSave);
 }