0
abu created
how we store data in two different table with one table primary key set as foreign key on second table with one method call.
public void CreateUser(CreateUserInput input)
{
var userinfo = new User
{
EmailID = input.EmailID,
Password = input.Password,
DateTimeLastUpdated = DateTime.Now,
DateTimeLastLogin = DateTime.Now,
IsActive = 0,
IsVerified = 0
};
userinfo.Id = _userRepository.InsertOrUpdateAndGetId(userinfo);
uid = userinfo.Id;
try
{
if (uid!= 0)
{
var companyinfo = new CompanyProfile
{
UserId = uid,
CompanyName = input.CompanyName
};
_companyprofileRepository.Insert(companyinfo);
}
}
catch (Exception ex)
{
throw ex;
}
getting internal error in this part
3 Answer(s)
-
0
Can you include the exception message you are getting as well as the stack trace?
-
0
Your code seems correct. You should share exception details here. You can find it in logs.
-
0
sir this problem is resolved because there is such fields in the table which is not null and i am not inserting data.. thank you sir for your reply