Skip to content

Commit d039ab7

Browse files
Minor changes - Picture service
1 parent 50334c7 commit d039ab7

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

src/Business/Grand.Business.Storage/Services/PictureService.cs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -711,6 +711,7 @@ public virtual async Task UpdatField<T>(Picture picture, Expression<Func<Picture
711711
await _cacheBase.RemoveByPrefix(string.Format(CacheKey.PICTURE_BY_ID, picture.Id));
712712

713713
}
714+
714715
/// <summary>
715716
/// Save picture on file system
716717
/// </summary>
@@ -748,15 +749,15 @@ public virtual async Task<Picture> SetSeoFilename(string pictureId, string seoFi
748749
//update if it has been changed
749750
if (seoFilename != picture.SeoFilename)
750751
{
751-
//update picture
752-
picture = await UpdatePicture(picture.Id,
753-
await LoadPictureBinary(picture),
754-
picture.MimeType,
755-
seoFilename,
756-
picture.AltAttribute,
757-
picture.TitleAttribute,
758-
true,
759-
false);
752+
//update SeoFilename picture
753+
picture.SeoFilename = seoFilename;
754+
await UpdatField(picture, p=> p.SeoFilename, seoFilename);
755+
756+
//event notification
757+
await _mediator.EntityUpdated(picture);
758+
759+
//clare cache
760+
await _cacheBase.RemoveByPrefix(string.Format(CacheKey.PICTURE_BY_ID, picture.Id));
760761
}
761762
return picture;
762763
}

0 commit comments

Comments
 (0)