DocSas/PropertyService.Domain/ModelView/NewsPosts/NewsPostProvider.cs
/// <summary>
/// save news post as an asynchronous operation.
/// </summary>
/// <param name="postVM">The post vm.</param>
/// <returns>Task&lt;DSCResponse&gt;.</returns>
save news post as an asynchronous operation.
save news post as an asynchronous operation .
public async Task<DSCResponse> SaveNewsPostAsync(PostVM postVM)
        {
            var msg = new Dictionary<string, string>();
            var response = new DSCResponse();
            var newsPost = _mapper.Map<PostVM, NewsPost>(postVM);
            if (newsPost != null)
            {
                await _newsPostRepo.AddAsync(newsPost);
            }
            response.ResponseData = newsPost;
            response.ErrorMessage = msg;
            return response;
        }
public async Task < DSCResponse > SaveNewsPostAsync ( PostVM postVM ) { var msg = new Dictionary < string , string > ( ) ; var response = new DSCResponse ( ) ; var newsPost = _mapper . Map < PostVM , NewsPost > ( postVM ) ; if ( newsPost != null ) { await _newsPostRepo . AddAsync ( newsPost ) ; } response . ResponseData = newsPost ; response . ErrorMessage = msg ; return response ; }
save news post as an asynchronous operation.
save news post as an asynchronous operation .
None
postVM
PostVM
The post vm.
The post vm .