Browse Source

Merge pull request #14040 from abpframework/EngincanV-patch-1

cms-kit: Fix type on `BlogFeatureAppService.cs`
pull/14047/head
Engincan VESKE 4 years ago
committed by GitHub
parent
commit
1911d87b49
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo/CmsKit/Blogs/BlogFeatureAppService.cs

4
modules/cms-kit/src/Volo.CmsKit.Common.Application/Volo/CmsKit/Blogs/BlogFeatureAppService.cs

@ -26,12 +26,12 @@ public class BlogFeatureAppService : CmsKitAppServiceBase, IBlogFeatureAppServic
{ {
var cacheItem = await Cache.GetOrAddAsync( var cacheItem = await Cache.GetOrAddAsync(
new BlogFeatureCacheKey(blogId, featureName), new BlogFeatureCacheKey(blogId, featureName),
() => GetOrDefaultFroRepositoryAsync(blogId, featureName)); () => GetOrDefaultFromRepositoryAsync(blogId, featureName));
return ObjectMapper.Map<BlogFeatureCacheItem, BlogFeatureDto>(cacheItem); return ObjectMapper.Map<BlogFeatureCacheItem, BlogFeatureDto>(cacheItem);
} }
protected virtual async Task<BlogFeatureCacheItem> GetOrDefaultFroRepositoryAsync(Guid blogId, string featureName) protected virtual async Task<BlogFeatureCacheItem> GetOrDefaultFromRepositoryAsync(Guid blogId, string featureName)
{ {
var feature = await BlogFeatureRepository.FindAsync(blogId, featureName); var feature = await BlogFeatureRepository.FindAsync(blogId, featureName);
var blogFeature = feature ?? new BlogFeature(blogId, featureName); var blogFeature = feature ?? new BlogFeature(blogId, featureName);

Loading…
Cancel
Save