Class StreamHelper<TDbContext, TEntity>
Provides helper methods for reading and writing large binary data streams directly to and from the database using Entity Framework Core.
public class StreamHelper<TDbContext, TEntity> : IStreamHelper<TEntity> where TDbContext : DbContext where TEntity : class
Type Parameters
TDbContext
The type of the EF Core DbContext.
TEntity
The entity type representing the target table.
- Inheritance
-
objectStreamHelper<TDbContext, TEntity>
- Implements
-
IStreamHelper<TEntity>
Constructors
- StreamHelper(IDbContextFactory<TDbContext>)
Initializes a new instance of the StreamHelper<TDbContext, TEntity> class.
Properties
- CommandTimeout
Gets or sets the SQL command timeout in seconds. Default is 600 (10 minutes).
Methods
- Get(Stream, Expression<Func<TEntity, object>>, Expression<Func<TEntity, bool>>)
Asynchronously retrieves a BLOB or binary column from the database and writes it to the provided output stream.
- Update(Stream, Expression<Func<TEntity, object>>, Expression<Func<TEntity, bool>>)
Asynchronously updates a BLOB or binary column in the database with the contents of the provided stream.