/// <summary> /// This method reads an entity based on the key passed. /// </summary> /// <param name="key">The key request.</param> /// <param name="options">These are the repository options which define the request type..</param> /// <returns>This is the holder containing the response and the entity where necessary.</returns> public virtual async Task <RepositoryHolder <SearchRequest, SearchResponse> > Search(SearchRequest key, RepositorySettings options = null) { var uri = mUriMapper.MakeUri(new HttpMethod("Search")); throw new NotImplementedException(); //using (var content = GetContent(entity)) //{ // return await CallClient<K, E>(uri, options, content: content, deserializer: DeserializeEntity, // mapper: (rs, holder) => ExtractHeaders(rs, holder, mKeyMapper)); //} }
/// <summary> /// This is the Create method. /// </summary> /// <param name="entity">The entity to create.</param> /// <param name="options">The optional parameters.</param> /// <returns>Returns the response with the entity if the request is successful.</returns> public virtual async Task <RepositoryHolder <K, E> > Create(E entity, RepositorySettings options = null) { var uri = mUriMapper.MakeUri(HttpMethod.Post); using (var content = GetContent(entity)) { return(await CallClient <K, E>(uri, options, content : content, deserializer : DeserializeEntity, mapper : (rs, holder) => ExtractHeaders(rs, holder, mKeyMapper))); } }