protected int FindAllCount() { try { if (!dbc.IsOpen) { dbc.Open(); } //Returns an object, not an int logger.LogInformation("FindAllCount complete."); return((int)dbc.Select <TEntity>().Count); } catch (Exception ex) { logger.LogError(ex.Message); return(0); } }