public TModel Search(Func <TModel, bool> func) { var model = _cache.GetFromCache(func); if (model is null) { var models = (IList <TModel>)_database.Database[typeof(TModel)]; model = models.SingleOrDefault(func); if (!(model is null)) { _cache.ThredSafeWorkWithCache(_cache.SetToCache, model); } } return(model); }