SqlServerDbSetExtensions.TemporalAsOf<TEntity> 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
對給定的資料庫集合套用時間「AsOf」操作,僅回傳資料庫中某一時間點存在的元素。
public static System.Linq.IQueryable<TEntity> TemporalAsOf<TEntity>(this Microsoft.EntityFrameworkCore.DbSet<TEntity> source, DateTime utcPointInTime) where TEntity : class;
static member TemporalAsOf : Microsoft.EntityFrameworkCore.DbSet<'Entity (requires 'Entity : null)> * DateTime -> System.Linq.IQueryable<'Entity (requires 'Entity : null)> (requires 'Entity : null)
<Extension()>
Public Function TemporalAsOf(Of TEntity As Class) (source As DbSet(Of TEntity), utcPointInTime As DateTime) As IQueryable(Of TEntity)
類型參數
- TEntity
參數
- source
- DbSet<TEntity>
原始資料庫集,該資料庫集是應用時間運算的來源。
傳回
IQueryable<TEntity>
an IQueryable 表示某一時間點的實體。
備註
資料庫中時間資訊以UTC格式儲存,因此在當地時間的 DateTime 爭論可能導致意想不到的結果。
時序查詢總是設定為「NoTracking」。
更多資訊與範例請參見「使用 EF Core 使用 SQL Server 時間資料表」。