Esempio n. 1
0
        public async Task <PostView> CreatePost(PostView postToCreate)
        {
            if (string.IsNullOrEmpty(postToCreate.PosterEmail))
            {
                throw new ArgumentNullException("Null Email");
            }
            var newPost = ViewModelFactory.CreateDomainModel(postToCreate);
            await _repository.CreateAsync(newPost);

            return(postToCreate);
        }
Esempio n. 2
0
 public async Task UpdatePost(PostView postToUpdate)
 {
     var updatedItem = ViewModelFactory.CreateDomainModel(postToUpdate);
     await _repository.UpdateAsync(updatedItem);
 }