public void Save(PeerAssignment peerAssignment, int UserId) { peerAssignment.CreatedBy = UserId.ToString(); peerAssignment.CreationDate = DateTime.Now; _dbContext.Add(peerAssignment); _dbContext.SaveChanges(); }
public IActionResult Add(int raterid, int id) { var UserId = int.Parse(HttpContext.Session.GetString("UserId")); var item = new PeerAssignment { Rater = _Services.GetAccountById(raterid), Ratee = _Services.GetAccountById(id), IsDeleted = false, IsExpired = false, Id = 0 }; _Services.Save(item, UserId); return(RedirectToAction("Assign", new { id = raterid })); }