public async Task <IActionResult> Edit(int id, [Bind("id,body,email,date_time")] Chirper chirper) { if (id != chirper.id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(chirper); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ChirperExists(chirper.id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(chirper)); }
public void ResetPosition() { ChirperUtils.CollapseChirperInstantly(); Chirper.builtinChirperPosition = DefaultPosition; Chirper.SetBuiltinChirperAnchor(ChirperAnchor.TopCenter); }
public async Task <IActionResult> Create([Bind("id,body,email,date_time")] Chirper chirper) { if (ModelState.IsValid) { _context.Add(chirper); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(chirper)); }
void UpdateMyFollowers(Chirper chirper, Follower follower, Action<MyFollowers, Follower> update) { var myFollowers = _myFollowersRepository.GetById(chirper.ChirperId); update.Invoke(myFollowers,follower); _myFollowersRepository.Update(myFollowers); }
void UpdateMyFollows(Follower follower, Chirper chirper, Action<MyFollows,Chirper> update) { var myFollows = _myFollowsRepository.GetById(follower.FollowerId); update.Invoke(myFollows,chirper); _myFollowsRepository.Update(myFollows); }
public void UpdateChirperAnchor() { Chirper.SetBuiltinChirperAnchor(CalculateAnchor()); }
public void RemoveFollow(Chirper follow) { if (_following.Contains(follow)) _following.Remove(follow); }
public void AddFollow(Chirper follow) { if (!_following.Contains(follow)) _following.Add(follow); }