This repository has been archived by the owner on Dec 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
TagHandler
Marco Siccardi edited this page Mar 16, 2018
·
1 revision
To get a new instance, either create an inline variable or use your favorite Locator:
//inline var
var handler = new TagHandler();
//MVVMLight (or any other Locator):
SimpleIoc.Default.Register<ITagHandler>(()=> new TagHandler());
If you want to add the "If-Modified-Since"-Header and "User-Agent"-Header, just fill in the parameters:
//inline var
var handler = new TagHandler(DateTime.Now, "MyAwesomeApp", "1.0.0");
//MVVMLight (or any other Locator):
SimpleIoc.Default.Register<TagHandler>(()=> new TagHandler(DateTime.Now, "MyAwesomeApp", "1.0.0"));
There are several ways to get and filter tags from the WordPress API:
var tags = handler.GetTagsAsync("yourBaseUrl");
Note that you have optional parameters for pages, page counts, and order of the results.
var tags = handler.SearchTagsAsync("yourBaseUrl", "your search terms");
Note that you have optional parameters for pages, page counts, 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.