DatabaseExtensionsSubmitChangesTEntity(DbContext) Method
Namespace: EWSoftware.EntityFrameworkAssembly: EWSoftware.EntityFramework (in EWSoftware.EntityFramework.dll) Version: 2025.11.12.0
public static void SubmitChanges<TEntity>(
this DbContext dataContext
)
where TEntity : class, INotifyPropertyChanged
<ExtensionAttribute>
Public Shared Sub SubmitChanges(Of TEntity As {Class, INotifyPropertyChanged}) (
dataContext As DbContext
)
public:
[ExtensionAttribute]
generic<typename TEntity>
where TEntity : ref class, INotifyPropertyChanged
static void SubmitChanges(
DbContext^ dataContext
)
[<ExtensionAttribute>]
static member SubmitChanges :
dataContext : DbContext -> unit when 'TEntity : not struct and INotifyPropertyChanged
- dataContext DbContext
- The data context to use for the operations
- TEntity
- The entity type for which to submit changes
In Visual Basic and C#, you can call this method as an instance method on any object of type
DbContext. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
This will get the changed entities from the data context's change tracker and submit them
accordingly. The state of the entities is also updated to reflect that they are in an unchanged
state after being added or updated or detached if deleted. If the connection is not in an open
state, it is opened temporarily while performing the actions.
if(dataContext.HasChanges())
dataContext.SubmitChanges<Account>();