Пример #1
0
        public async Task <Project> GetProject(string slug)
        {
            var projects = await _cache.GetProjects();

            var project = projects.FirstOrDefault(p => p.Data.Slug == slug);

            return(_mapper.MapToProject(project));
        }
Пример #2
0
        public async Task <Project> GetProject(string id)
        {
            var projects = await GetItemFromCache(CacheConstants.SquidexSchemas.Projects, () => _repo.GetProjects());

            var project = projects.FirstOrDefault(p => p.Id == id);

            return(_mapper.MapToProject(project));
        }