I have 2 excel files, reading them into List of model and AddRange to database however AddRange method not adding in the order listed in excel file
My models :
There is a relation between RawMaterialGroupTable and RawMaterialCode Table
Here are the excel files
First one is MaterialGroups will be written to database into RawMaterialGroupTable
The second is MaterialCodes will be written to database into RawMaterialCodeTable
However after AddRange when I look into database the order is like this not same with the order in excel file
2 methods writing to db
İn these two methods the parameter coming List<….> is in the order same as excel file after AddRange it changes
How can I solve this problem ?
Thanks in advance
I tried writing the excel file rows in the order however after AddRange it changes the order
1