Skip to content

Commit

Permalink
Minor changes - Picture service
Browse files Browse the repository at this point in the history
  • Loading branch information
KrzysztofPajak committed Aug 16, 2021
1 parent 50334c7 commit d039ab7
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/Business/Grand.Business.Storage/Services/PictureService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,7 @@ public virtual async Task UpdatField<T>(Picture picture, Expression<Func<Picture
await _cacheBase.RemoveByPrefix(string.Format(CacheKey.PICTURE_BY_ID, picture.Id));

}

/// <summary>
/// Save picture on file system
/// </summary>
Expand Down Expand Up @@ -748,15 +749,15 @@ public virtual async Task<Picture> SetSeoFilename(string pictureId, string seoFi
//update if it has been changed
if (seoFilename != picture.SeoFilename)
{
//update picture
picture = await UpdatePicture(picture.Id,
await LoadPictureBinary(picture),
picture.MimeType,
seoFilename,
picture.AltAttribute,
picture.TitleAttribute,
true,
false);
//update SeoFilename picture
picture.SeoFilename = seoFilename;
await UpdatField(picture, p=> p.SeoFilename, seoFilename);

//event notification
await _mediator.EntityUpdated(picture);

//clare cache
await _cacheBase.RemoveByPrefix(string.Format(CacheKey.PICTURE_BY_ID, picture.Id));
}
return picture;
}
Expand Down

0 comments on commit d039ab7

Please sign in to comment.