public JsonResult ProfilBilgileriDuzenle(ProfileListDTO entity) { try { var profil = db.user.Where(x => x.user_id == SabitlerDTO.KullaniciID).FirstOrDefault(); profil.user_name = entity.user_name; profil.user_email = entity.user_email; profil.user_password_salt = entity.user_password_salt; profil.city_id = entity.city_id; profil.user_cep = entity.user_cep; db.SaveChanges(); return(Json(profil, JsonRequestBehavior.AllowGet)); } catch (Exception) { return(null); } }
public JsonResult ProfilBilgileriYukle() { try { ProfileListDTO profile = db.user.Where(x => x.user_id == SabitlerDTO.KullaniciID).Select(s => new ProfileListDTO { user_id = s.user_id, user_name = s.user_name, user_email = s.user_email, user_password_salt = s.user_password_salt, city_id = s.city_id, user_cep = s.user_cep, }).FirstOrDefault(); return(Json(profile, JsonRequestBehavior.AllowGet)); } catch (Exception) { return(null); } }