Ejemplo n.º 1
0
 /// <summary>
 /// Get an entity is added to database.
 /// </summary>
 /// <param name="id">Entity.</param>
 /// <returns>Return true if database contains this entity.</returns>
 public virtual async Task <bool> ContainsAsync(Guid id)
 {
     return(await DbSet.CountAsync(t => t.Index == id) > 0);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Get total entity count from database.
 /// </summary>
 /// <returns>Return total entity count number.</returns>
 public virtual async Task <int> CountAsync()
 {
     return(await DbSet.CountAsync());
 }