Exemple #1
0
 /// <summary>
 /// Gets this instance.
 /// </summary>
 /// <param name="client">The client.</param>
 /// <returns></returns>
 public Task <HyperList <T> > Get(HyperClient client)
 {
     return(client.Get <HyperList <T> >(Href));
 }
Exemple #2
0
 /// <summary>
 /// Gets the specified id.
 /// </summary>
 /// <param name="id">The id.</param>
 /// <param name="client">The client.</param>
 /// <returns></returns>
 public Task <T> Get(string id, HyperClient client)
 {
     return(client.Get <T>(new Uri(new Uri(Href), id).ToString()));
 }
Exemple #3
0
 /// <summary>
 /// Posts the specified item.
 /// </summary>
 /// <param name="item">The item.</param>
 /// <param name="client">The client.</param>
 /// <returns></returns>
 public Task <T> Post(T item, HyperClient client)
 {
     return(client.Post(Href, item));
 }
 /// <summary>
 /// Deletes the specified item.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="item">The item.</param>
 /// <param name="client">The client.</param>
 /// <param name="expectedCode">The expected code.</param>
 /// <returns>Task object.</returns>
 public static Task Delete <T>(this T item, HyperClient client, HttpStatusCode expectedCode = HttpStatusCode.OK) where T : IHyperEntity <T>
 {
     return(client.Delete(item.Self.Href, expectedCode));
 }
 /// <summary>
 /// Puts the specified item.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="item">The item.</param>
 /// <param name="client">The client.</param>
 /// <returns></returns>
 public static Task <T> Put <T>(this T item, HyperClient client) where T : IHyperEntity <T>
 {
     return(client.Put(item.Self.Href, item));
 }
 /// <summary>
 /// Gets the specified item.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="item">The item.</param>
 /// <param name="client">The client.</param>
 /// <returns></returns>
 public static Task <T> Get <T>(this T item, HyperClient client) where T : IHyperEntity <T>
 {
     return(client.Get <T>(item.Self.Href));
 }
 /// <summary>
 /// Gets the specified list.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="list">The list.</param>
 /// <param name="id">The id.</param>
 /// <param name="client">The client.</param>
 /// <returns></returns>
 public static Task <T> Get <T>(this HyperListLink <T> list, int id, HyperClient client) where T : IHyperEntity <T>
 {
     return(list.Get(id.ToString(), client));
 }