Beispiel #1
0
        public async Task <Post> AddPost(Post post)
        {
            try
            {
                var res = await _aspContext.Post.AddAsync(post);

                await _aspContext.SaveChangesAsync();

                return(res.Entity);
            }
            catch (Exception)
            {
                throw;
            }
        }
Beispiel #2
0
        public async Task <LikeOrDisLikes> AddLikeOrDisLikes(LikeOrDisLikes vote)
        {
            try
            {
                var res = await _aspContext.LikeOrDisLikes.AddAsync(vote);

                await _aspContext.SaveChangesAsync();

                return(res.Entity);
            }
            catch (Exception)
            {
                throw;
            }
        }
Beispiel #3
0
        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;
            }
        }
Beispiel #4
0
        public async Task <Comments> AddComments(Comments comments)
        {
            try
            {
                var res = await _aspContext.Comments.AddAsync(comments);

                await _aspContext.SaveChangesAsync();

                return(res.Entity);
            }
            catch (Exception)
            {
                throw;
            }
        }
Beispiel #5
0
        public async Task <Blog> AddBlog(Blog blog)
        {
            try
            {
                var res = await _aspContext.Blog.AddAsync(blog);

                await _aspContext.SaveChangesAsync();

                return(res.Entity);
            }
            catch (Exception)
            {
                throw;
            }
        }