I have updated a record in c# web api. I want only first name and last name update but i have check database first name and last name update but other field null .
pls solve isssue.
public UserEditResponse EditAppProfile(UserDetails objParam)
{
UserEditResponse obj = new UserEditResponse();
UserDetails obj_EditUser = new UserDetails();
try
{
var user = _db.FranchiseMasters.Where(x => x.IdFranchise == objParam.UserId).FirstOrDefault();
if (user != null)
{
user.FirstName = objParam.FirstName;
user.LastName = objParam.LastName;
user.PhoneNumber = objParam.PhoneNumber;
user.ProfileImage = objParam.ProfileImage;
user.Email = objParam.Email;
user.Password = objParam.Password;
user.Address = objParam.Address;
user.CreatedDate = DateTime.Now;
//user.IsVerifiedByOtp = objParam.IsVerifiedByOtp;
user.TokenFCM = objParam.TokenFCM;
user.LoginType = objParam.LoginType;
user.LastLogin = objParam.LastLogin;
user.AuthenticationId = objParam.AuthenticationId;
user.DeviceType = objParam.DeviceType;
_db.SaveChanges();
obj.Response = 1;
obj.ErrorMessage = "No Error Found";
it's me code.
Amit MohantyRank #112 · 20K reputationPosted Mar 5, 2020, 10:07 PM EST
Sreekanth ReddyRank #726 · 3.2K reputationPosted Mar 5, 2020, 7:39 PM EST
Posted Mar 5, 2020, 8:51 PM EST
Ajay GohilRank #2,370 · 599 reputationPosted Mar 5, 2020, 10:11 PM EST
Amin Memar185 reputationPosted Mar 6, 2020, 2:32 AM EST
Jignesh KumarRank #91 · 22.9K reputationPosted Mar 6, 2020, 5:40 PM EST
Laxmidhar SahooRank #383 · 6.6K reputationPosted Mar 6, 2020, 10:22 PM EST
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts