public static UserNameSurname ToUserNameSurName(dynamic ToConvert) { UserNameSurname ToSend = new UserNameSurname(); ToSend.Name = ToConvert.Name; ToSend.SurName = ToConvert.SurName; return(ToSend); }
public ActionResult ChangeNameSurName() { if (AuthorityCheck()) { return(RedirectToAction("Index", "Home")); } int ID = Convert.ToInt32(Session["UserID"]); UserNameSurname ToEdit = Converter.ToUserNameSurName(_db.Users.Where(x => x.BaseUserID == ID).Select(x => new { x.Name, x.SurName }).FirstOrDefault()); return(View(ToEdit)); }