public ApiResult Add(ImageItem imageItem) { var imageItemBefore = imageItem.DeepClone(); var result = inner.Add(imageItemBefore); if (!result.Succeeded && LogError || result.Succeeded && LogChangeSucceeded || stopwatch.ElapsedMilliseconds > LogLongTime) { logRepository.Add(new LogItem(stopwatch, userId, Guid.Empty, result, imageItemBefore)); } return(result); }