示例#1
0
        public ActionResult <TResource> Create(TAlterResource createResource)
        {
            var response = Client.Create(createResource).Result;

            if (response.IsSuccess)
            {
                ResourceIdsHolder.Add <TResource>(response.Value.Id);
            }
            return(response);
        }
示例#2
0
        public ActionResult <TResource> Create()
        {
            var createResource = RandomResourceCreator.GetRandomCreateResource();
            var response       = Client.Create(createResource).Result;

            if (response.IsSuccess)
            {
                ResourceIdsHolder.Add <TResource>(response.Value.Id);
            }
            return(response);
        }
示例#3
0
        public ActionResult <IEnumerable <TResource> > Create(IEnumerable <TAlterResource> createResources)
        {
            var result = Client.BatchCreate(createResources.ToArray()).Result;

            if (result.IsSuccess)
            {
                foreach (var resource in result.Value)
                {
                    ResourceIdsHolder.Add <TResource>(resource.Id);
                }
            }
            return(result);
        }