Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Looking at the mini profiler I can see several DB calls being made during render that relate to nuPickers.
The query in question seems to return the config for one of my nupicker data types. On a second request it doesn't get called, but fairly soon (20 secs) after it will get called again.
Why would the render be requesting this config? I'm guess it is so that you can tell if it is XML or CSV, but if so then inspecting the format of the property's value would be a lot quicker.
Is there any way to increase the cache time?
Can you post the razor snippet ? (I don't think nuPickers should query the DB on rendering - unless it's using DB relations)
Well my extension method nuPickers.Picker.AsGuids() appears to be the last place that it touches my code, which is this:
public static IEnumerable<Guid> AsGuids(this nuPickers.Picker picker)
return picker == null ? new Guid : picker.PickedKeys.AsGuids();
To be clear, the reference to AsGuids in the code above is a reference to a different method of the same name(below), but the stack trace suggests this is never called.
public static IEnumerable<Guid> AsGuids(this IEnumerable<string> source)
foreach (var s in source)
if (Guid.TryParse(s, out r))
yield return r;
It is a dotnet source though. This is the source:
public class NewsSubjectPickerSource : IDotNetDataSource
IEnumerable<KeyValuePair<string, string>> IDotNetDataSource.GetEditorDataItems(int contextId)
var newsService = new NewsService(UmbracoContext.Current);
return newsService.Subjects.Distinct().ToDictionary(c => c.UniqueId.ToString(), c => c.SubjectName);
In GetEditorDataItems the call to newsService.Subjects just results in loading from cache (or fetching) some nested content IPublishedContent items, but I can't see anything here relating to nuPickers to which the DB call relates.
Is there any way to step the code and see at what point that DB call is made?
My guess would be that it's something to do with the check for the property-editor save format: https://github.com/uComponents/nuPickers/blob/master/source/nuPickers/Picker.cs#L102
which calls the Umbraco DataTypeService:
Just had a chat with Jeavon, and this can be fixed by caching the pre-values after first query - will create an issue on GitHub.
That makes sense. I think it might be doing some caching already (though it could be my own caching) as I wasn't seeing this everytime.
Thanks for identifying the issue, I'll live with it for now and upgrade when I can.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted