Ejemplo n.º 1
0
        public void Create(DtoRetweet entity)
        {
            var  gelen      = Mapper.Map <Retweet>(entity);
            var  sorgu      = unit.Retweetrepo.GetLike(entity.TweetId).Where(x => x.UserId == entity.UserId).Select(x => x.Isdeleted == true).Any();
            bool gelentivit = unit.Tweetterrepo.GetAll().Any(x => x.Id == entity.TweetId && x.Replyto == entity.UserId);


            var tweet = unit.Tweetterrepo.GetById(entity.TweetId);

            tweet.Replyto     = entity.UserId;
            tweet.Isactive    = entity.Isactive;
            tweet.Createddate = tweet.Createddate;
            tweet.Isdeleted   = tweet.Isdeleted;
            tweet.Text        = tweet.Text;
            tweet.UserId      = tweet.UserId;

            if (gelentivit == true)
            {
                unit.Tweetterrepo.updatestate(tweet);
                unit.Save();
            }



            if (sorgu == true)
            {
                unit.Retweetrepo.updatestate(gelen);
                unit.Save();
            }
            else
            {
                unit.Retweetrepo.Create(gelen);
                unit.Save();
            }
        }
Ejemplo n.º 2
0
 public void Update(DtoRetweet entity)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 3
0
        public IActionResult rtoperation(DtoRetweet entity)
        {
            rt.Create(entity);

            return(Json(true));
        }