I have a little question.
Short description of the project: I'm working on a little API project written in C#. Inside this project I'm using the onion architecture, in short it's something like Controller -> Service -> Repository.
I have an Account controller, which manages create & update User and beside this I have a databas ewith the following tables:
User, Password, UserInformation
In User
I have the following columns: Id(PK), userName and role.
In Password
I have: User_Id(PK and FK to User - Id column), password and oldPassword (if necessary).
In UserInformation
I have: User_Id(PK and FK to User - Id column), firstName, lastName and email.
As for inserting data, I have a separate class with string constants inside which are queries and I'm executing them by doing
sqlConnection.QueryAsync(QueryFromStringConstants, etcParams).
As I'm a little bit noobish with the SQL syntax and everything related to SQL in general(haha), my question is: if I create a User
, how can I insert data into all 3 tables at the same time?
Thanks :)