Click or drag to resize

RGDataContextBase Class

RGDataContextBase
Inheritance Hierarchy

Namespace:  Recrovit.RecroGridFramework.Data
Assembly:  Recrovit.RecroGrid (in Recrovit.RecroGrid.dll) Version: 2.6.0
Syntax
C#
public abstract class RGDataContextBase

The RGDataContextBase type exposes the following members.

Constructors
  NameDescription
Public methodRGDataContextBase
Initializes a new instance of the RGDataContextBase class.
Top
Properties
  NameDescription
Public propertyConnection
Returns the connection being used by this context.
Public propertyContext
Gets the Database context.
Protected propertyDataContext
Gets the data context.
Public propertyEntityNames
Gets the entity names.
Public propertyEntityTypes
Gets the entity types.
Public propertyLogger
Gets the logger.
Public propertyNoTracking
Gets a value indicating whether [no tracking].
Top
Methods
  NameDescription
Public methodAddObjectTEntity
Adds an object to the object context.
Public methodDeleteObjectTEntity
Marks an object for deletion.
Public methodExecuteStoreCommand
Executes an arbitrary command directly against the data source using the existing connection. The command is specified using the server's native query language, such as SQL. As with any API that accepts SQL it is important to parameterize any user input to protect against a SQL injection attack. You can include parameter place holders in the SQL query string and then supply parameter values as additional arguments. Any parameter values you supply will automatically be converted to a DbParameter. context.ExecuteStoreCommand("UPDATE dbo.Posts SET Rating = 5 WHERE Author = @p0", userSuppliedAuthor); Alternatively, you can also construct a DbParameter and supply it to SqlQuery. This allows you to use named parameters in the SQL query string. context.ExecuteStoreCommand("UPDATE dbo.Posts SET Rating = 5 WHERE Author = @author", new SqlParameter("@author", userSuppliedAuthor));
Public methodExecuteStoreCommandAsync
Asynchronously executes an arbitrary command directly against the data source using the existing connection. The command is specified using the server's native query language, such as SQL. As with any API that accepts SQL it is important to parameterize any user input to protect against a SQL injection attack. You can include parameter place holders in the SQL query string and then supply parameter values as additional arguments. Any parameter values you supply will automatically be converted to a DbParameter. context.ExecuteStoreCommandAsync("UPDATE dbo.Posts SET Rating = 5 WHERE Author = @p0", userSuppliedAuthor); Alternatively, you can also construct a DbParameter and supply it to SqlQuery. This allows you to use named parameters in the SQL query string. context.ExecuteStoreCommandAsync("UPDATE dbo.Posts SET Rating = 5 WHERE Author = @author", new SqlParameter("@author", userSuppliedAuthor));
Public methodGetObjectByKeyTEntity
Returns an object that has the specified entity key.
Public methodSaveChangesAsync(CancellationToken)
Saves all changes made in this context to the database. This method will automatically call Microsoft.EntityFrameworkCore.ChangeTracking.ChangeTracker.DetectChanges to discover any changes to entity instances before saving to the underlying database. This can be disabled via Microsoft.EntityFrameworkCore.ChangeTracking.ChangeTracker.AutoDetectChangesEnabled. Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.
Public methodSaveChangesAsync(Boolean, CancellationToken)
Saves all changes made in this context to the database. This method will automatically call Microsoft.EntityFrameworkCore.ChangeTracking.ChangeTracker.DetectChanges to discover any changes to entity instances before saving to the underlying database. This can be disabled via Microsoft.EntityFrameworkCore.ChangeTracking.ChangeTracker.AutoDetectChangesEnabled. Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.
Public methodSelectTEntity
Projects each element of a sequence into a new form.
Top
See Also