public Post Add(PostDto postDto) { var post = new Post() { CategoryId = postDto.CategoryId, UserId = postDto.UserId, Content = postDto.Content, PublishDate = DateTime.Now, Title = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(postDto.Title) }; return(_postDal.Add(post)); }
public bool AddPost(Post post) { try { post.CreationDate = DateTime.Now; post.UserId = _customUserService.GetCurrentUser().Id; post.IsActive = true; _postDal.Add(post); _postDal.Save(); return(true); } catch (Exception exp) { return(false); } }
public bool AddPost(PostDto postDto) { try { var post = new Post() { CreationDate = postDto.CreationDate, IsActive = postDto.IsActive, UserId = _customUserService.GetCurrentUser().Id }; _postDal.Add(post); _postDal.Save(); return(true); } catch (Exception exp) { return(false); } }
public IResult Add(Post entity) { _postDal.Add(entity); return(new SuccessResult(Messages.Postadded)); }
public Task Add(Post post) { return(_postDal.Add(post)); }
public void Add(Post data) { _postDal.Add(data); }
public Post Add(Post post) { _postDal.Add(post); return(post); }
public Post Insert(Post post) { _postDal.Add(post); return(post); }
public void Add(Post entity) { _postDal.Add(entity); }
public void Add(Post post) { _postDal.Add(post); }
public IResult Add(Post post) { _postDal.Add(post); return(new SuccessResult(CrudMessages.PostAdded)); }
public IResult Add(Post post) { _postDal.Add(post); return(new SuccessResult(Messages.Successful)); }
public bool Add(Post post) { return(_postDal.Add(post)); }
public Post Add(Post post) { return(_postDal.Add(post)); }