Esempio n. 1
0
 public void MergeFrom(SaveDiaryRes other)
 {
     if (other == null)
     {
         return;
     }
     if (other.Ret != 0)
     {
         Ret = other.Ret;
     }
     if (other.userDiary_ != null)
     {
         if (userDiary_ == null)
         {
             userDiary_ = new global::Com.Proto.UserDiaryPB();
         }
         UserDiary.MergeFrom(other.UserDiary);
     }
     if (other.userFavorability_ != null)
     {
         if (userFavorability_ == null)
         {
             userFavorability_ = new global::Com.Proto.UserFavorabilityPB();
         }
         UserFavorability.MergeFrom(other.UserFavorability);
     }
 }
 public IActionResult UpdateUserDiary(int id, [FromBody] UserDiary diary)
 {
     if (id > 0 && diary != null)
     {
         _context.UserDiary.Update(diary);
         _context.SaveChanges();
         return(Ok(new { Message = "Request Completed" }));
     }
     return(BadRequest(new { Message = "Invalid Request" }));
 }
 public IActionResult AddUserDiary([FromBody] UserDiary diary)
 {
     if (diary != null)
     {
         _context.UserDiary.Add(diary);
         _context.SaveChanges();
         return(Ok(new { Message = "Request Completed" }));
     }
     return(BadRequest(new { Message = "Invalid Request" }));
 }
Esempio n. 4
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Ret != 0)
            {
                hash ^= Ret.GetHashCode();
            }
            if (userDiary_ != null)
            {
                hash ^= UserDiary.GetHashCode();
            }
            if (userFavorability_ != null)
            {
                hash ^= UserFavorability.GetHashCode();
            }
            return(hash);
        }