So you've already tied to the user to the branch when they get registered into the User table that gets created in the identity framework right?
When you get a user (assuming you are using entity framework) you should be able to get the transaction id by an EF select statement (var user = users.Where(m=>m.username == "").select(m=>m.transactions);).
But to the main point of your issue.
I think, whatever data you are storing, you'll need to include the transaction guid/id from the user in the row being saved to the database.
To store the data, you could create an extension method on the IIdentity interface to get access to the transaction id tied to that user. Something like this
public static string GetTransactionId(this IIdentity identity)
{
var username = identity.GetUserName();
var users = userstable.Where(m => m.UserName == username).Select(m => m.Transactions).FirstOrDefault;
if (user == null)
{
return "";
}
var transId = users.TransactionId;
return transId;
}
Then the usage would simply be
User.Identity.GetTransactionId()
You'd be able to use this to get the transaction id and then save it to the table.
From there, in your controller/models you'd get the data from your DB by passing in the transcation id from the controller.
Something like
var transactionId = User.Identity.GetTransactionId();
var model = new MyDataModel();
model.Build(transactionId);
Then within your model you'd do something along the lines of
var mydatainmodel = tableindb.Where(m=>m.TransactionId == transactionIdPassedIn);
I may have mixed terminology between what you called "branch" and "transaction" but hopefully this steers you in the right direction.