Technology at hand:
Problem:I am working on some programs. There is a definite problem that causes a serious slowdown. With an EF DataContextwith about 43 ADDEDentities, the method DataContext.SaveChanges()takes on the whole load of time.
DataContext
ADDED
DataContext.SaveChanges()
Using SQL Profiler, I see that inserts occur with a duration (about) 0ms. This is as expected.
0ms
Using ANTS Profiler, I see DataContext.SaveChanges()(about) 1500 ms. Turning on it, 99.9%this time is spent inside SNINativeMethodWrapper.SNIReadSyncOverAsync.
99.9%
SNINativeMethodWrapper.SNIReadSyncOverAsync
Google, ( , , ). , 2 ( !).
SO, , :
, :
, EF. ( ), .
Context.Configuration.ValidateOnSaveEnabled = false;
Context.Configuration.AutoDetectChangesEnabled = false;
:- , ?
:
, dbcontext ( -ambient DbContext), , / , (, , ), . , .
: "" Db ( , , ), EF , / , , DbContext (Connection, bool contextOwnsConnection = true) . , . , DELETE/UPDATE/INSERT ( , ) .
Source: https://habr.com/ru/post/1618607/More articles:https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1618602/how-do-i-convert-a-vector-of-strings-to-a-vector-of-integers-in-a-functional-way&usg=ALkJrhgLuMx_1ZjNKs9jQ5b2XgLW8RFfqwInject request scoped bean to another bean - javaПоддержка Websocket в управляемом vm - google-app-engineAndroid Studio: install the patch to update - android2D arrays in javascript - javascripthttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1618608/avoid-multiple-calls-to-fprintf-when-writing-vector-of-values-and-newline&usg=ALkJrhjS9JBWUXnRXU7JRP3jkZpQlwmwsAWindows Forms Designer, Design Basis> GenerateMember - c #Ошибка Html.CheckBoxFor TypeConversition - c#Reply to answer using Facebook API - facebook-graph-apiDplyr application renamed to all columns using pipe operator - syntaxAll Articles