You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Marco Siccardi edited this page Mar 16, 2018
·
2 revisions
To get a new instance, either create an inline variable or use your favorite Locator:
//inline varvarhandler=newMediaHandler();//MVVMLight (or any other Locator):SimpleIoc.Default.Register<IMediaHandler>(()=>newMediaHandler());
If you want to add the "If-Modified-Since"-Header and "User-Agent"-Header, just fill in the parameters:
//inline varvarhandler=newMediaHandler(DateTime.Now,"MyAwesomeApp","1.0.0");//MVVMLight (or any other Locator):SimpleIoc.Default.Register<IMediaHandler>(()=>newMediaHandler(DateTime.Now,"MyAwesomeApp","1.0.0"));
getting a list of media with default parameters:
varmedia=handler.GetMediaAsync("yourBaseUrl");
Note that you have optional parameters for pages, page counts, media type, mime type and order of the results.
All above calls will result in a WordPressEntitySet<TWordPressEntity> or a WordPressEntity<TWordPressEntity>. If there was an error on the API side, the Error property will be filled, otherwise it will be null and the Value will hold the result.