public async Task <Post> AddPost(Post post) { try { var res = await _aspContext.Post.AddAsync(post); await _aspContext.SaveChangesAsync(); return(res.Entity); } catch (Exception) { throw; } }
public async Task <LikeOrDisLikes> AddLikeOrDisLikes(LikeOrDisLikes vote) { try { var res = await _aspContext.LikeOrDisLikes.AddAsync(vote); await _aspContext.SaveChangesAsync(); return(res.Entity); } catch (Exception) { throw; } }
public async Task <User> AddUsers(User user) { try { var res = await _aspContext.User.AddAsync(user); await _aspContext.SaveChangesAsync(); return(res.Entity); } catch (Exception ex) { throw ex; } }
public async Task <Comments> AddComments(Comments comments) { try { var res = await _aspContext.Comments.AddAsync(comments); await _aspContext.SaveChangesAsync(); return(res.Entity); } catch (Exception) { throw; } }
public async Task <Blog> AddBlog(Blog blog) { try { var res = await _aspContext.Blog.AddAsync(blog); await _aspContext.SaveChangesAsync(); return(res.Entity); } catch (Exception) { throw; } }