c# - SQLBulk Copy With Related Entities (Entity Framework) -


Say I have entities below (Simplified simpler for brevity, but with key properties included) < Pre> public class offense {[key] public intrite crimeID {receive; Set;} Public Virtual Ilkonak & lt; Hunting & gt; Public Virtual Crime Disability Details {Received; Set}} public class beatim {{key} public entity id {set; Set;} public string bitum category {set; Set;}} Public Square Criminal Dupit {[Key] Public Entity ID {get; Set}} public string descriptionTech {{get; Set}}}

I have more than 600,000 records that are included in SQL Server 2008 Express R2, which takes a lot of time using the unit framework 4.4.

Ideally I want to use SQLBulkCopy to batch these records, but since it does not support complex types (not least the box), So I'm trying to find some other potential solutions.

If needed, I want to change my model.

EDIT: What is the help in this example?

Can be used for SQLBulkCopy.

(We did not actually coded those classes, they were generated using xsd usage from xsd definition of 1-10 gb xml file. I'm just trying to remember when we are the same Prepare a dataset typed with XSD, but it seems irrelevant to your problem.)

Depending on how you are getting those 600+ records, you can either change the code Strictly typed data Using freight or some object-to-object mapper is being given the same name to use to map the dataset to its EF Paco objects as properties.

Here is the creation of strongly typed datasets.

How to use SqlBulkInsert here.

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -