DocSas/PropertyService.Domain/ModelView/NewsPosts/NewsPostProvider.cs
/// <summary>
/// delete news post as an asynchronous operation.
/// </summary>
/// <param name="userId">The user identifier.</param>
/// <param name="postId">The post identifier.</param>
/// <returns>Task&lt;DSCResponse&gt;.</returns>
delete news post as an asynchronous operation.
delete news post as an asynchronous operation .
public async Task<DSCResponse> DeleteNewsPostAsync(Guid userId, Guid postId)
        {
            var response = new DSCResponse();
            var isSuccess = false;
            var post = await _newsPostRepo.GetSingleAsync(x => x.Id == postId && x.UserId == userId);
            if (post != null)
            {
                isSuccess =  await _newsPostRepo.DeleteAsync(post);
            }
            response.ResponseData = isSuccess;
            return response;
        }
public async Task < DSCResponse > DeleteNewsPostAsync ( Guid userId , Guid postId ) { var response = new DSCResponse ( ) ; var isSuccess = false ; var post = await _newsPostRepo . GetSingleAsync ( x => x . Id == postId && x . UserId == userId ) ; if ( post != null ) { isSuccess = await _newsPostRepo . DeleteAsync ( post ) ; } response . ResponseData = isSuccess ; return response ; }
delete news post as an asynchronous operation.
delete news post as an asynchronous operation .
None
userId
Guid
The user identifier.
The user identifier .
postId
Guid
The post identifier.
The post identifier .