Example #1
0
 public virtual async Task <ResourceCollection <TResource> > ConvertToResourceCollectionAsync(IEnumerable <TModel> models, ExpandQuery expand)
 {
     return(new ResourceCollection <TResource>(await ConvertToResourcesAsync(models, expand))
     {
         Href = UrlProvider.GetRequestUri()
     });
 }
Example #2
0
 public abstract Task <TResource> ConvertToResourceAsync(TModel model, ExpandQuery expand);
Example #3
0
        public virtual async Task <IEnumerable <TResource> > ConvertToResourcesAsync(IEnumerable <TModel> models, ExpandQuery expand)
        {
            List <TResource> resources = new List <TResource>();

            foreach (var model in models)
            {
                resources.Add(await ConvertToResourceAsync(model, expand));
            }
            return(resources);
        }