Hi folks,
I have created Seed data as below:
var subModules = new SubModule[] { new SubModule{ ModuleID=1, Name="***" }, new SubModule{ ModuleID=1, Name="***" }, new SubModule{ ModuleID=1, Name="***" }, new SubModule{ ModuleID=2, Name="***" }, new SubModule{ ModuleID=2, Name="***" }, new SubModule{ ModuleID=2, Name="***" }, new SubModule{ ModuleID=2, Name="***" }, new SubModule{ ModuleID=2, Name="***" }, new SubModule{ ModuleID=2, Name="***" }, new SubModule{ ModuleID=3, Name="***" }, new SubModule{ ModuleID=3, Name="***" }, new SubModule{ ModuleID=3, Name="***" }, new SubModule{ ModuleID=3, Name="***" }, new SubModule{ ModuleID=3, Name="***" }, new SubModule{ ModuleID=3, Name="***" }, new SubModule{ ModuleID=4, Name="***" }, new SubModule{ ModuleID=4, Name="***" }, new SubModule{ ModuleID=4, Name="***" }, new SubModule{ ModuleID=5, Name="***" }, new SubModule{ ModuleID=5, Name="***" }, new SubModule{ ModuleID=5, Name="***" }, new SubModule{ ModuleID=5, Name="***" }, new SubModule{ ModuleID=6, Name="***" }, new SubModule{ ModuleID=6, Name="***" }, new SubModule{ ModuleID=6, Name="***" }, ........ }; foreach (SubModule item in subModules) { context.SubModules.Add(item); } context.SaveChanges();
After run the project, It goes into a table. It seems ok but i want sort (Ascending order) of module id. Any idea?
I am waiting for your response.
Thanks in Advance!