示例#1
0
        public async Task <SiteViewModel> UpdateSiteAsync(Guid id, SiteViewModel siteToUpdate)
        {
            var query = new GraphQLRequest
            {
                Query     = @"
                mutation($site: siteInput!, $siteId: ID!){
                  updateSite(site: $site, siteId: $siteId){
                    id
                    name
                    culture
                    domain
                  }
               }",
                Variables = new { site = siteToUpdate, siteId = id }
            };

            var response = await _client.PostAsync(query);

            return(response.GetDataFieldAs <SiteViewModel>("updateSite"));
        }
示例#2
0
        public async Task <SiteViewModel> CreateSiteAsync(SiteViewModel siteToCreate)
        {
            var query = new GraphQLRequest
            {
                Query     = @"
                mutation($site: siteInput!){
                  createSite(site: $site){
                    id
                    name
                    culture
                    domain
                  }
                }",
                Variables = new { site = siteToCreate }
            };

            var response = await _client.PostAsync(query);

            return(response.GetDataFieldAs <SiteViewModel>("createSite"));
        }
示例#3
0
 public void OnGet()
 {
     Site = _client.GetSiteByCultureAsync("en-GB").Result;
 }
示例#4
0
 public Task <SiteViewModel> UpdateSiteAsync(Guid id, SiteViewModel siteToUpdate)
 {
     throw new NotImplementedException();
 }
示例#5
0
 public Task <SiteViewModel> CreateSiteAsync(SiteViewModel siteToCreate)
 {
     throw new NotImplementedException();
 }