public void UpdateCustomizedModel(CustomizedModel customizedModel, string defineID)
        {
            string colDesc   = Serializer.JsonSerialize(customizedModel.CustomizedModelContent);
            string updateStr = $@"Update planitemcustomization set modeldesc='{colDesc}' where plandefineid='{defineID}' and tenantid='{Utils.GetTenantId()}'";

            db.ExecSqlStatement(updateStr);
        }
        public void SaveCustomizedModel(CustomizedModel customizedModel, string defineID)
        {
            string insertStr = @"insert into planitemcustomization(id,tenantid,modeldesc,plandefineid) values({0},{1},{2},{3})";

            string colDesc = Serializer.JsonSerialize(customizedModel.CustomizedModelContent);

            db.ExecSqlStatement(insertStr, Guid.NewGuid().ToString(), Utils.GetTenantId(), colDesc, defineID);
        }
        public Response Operation(CustomizedModel body = null, CancellationToken cancellationToken = default)
        {
            using var message = CreateOperationRequest(body);
            _pipeline.Send(message, cancellationToken);
            switch (message.Response.Status)
            {
            case 200:
                return(message.Response);

            default:
                throw _clientDiagnostics.CreateRequestFailedException(message.Response);
            }
        }
        public async Task <Response> OperationAsync(CustomizedModel body = null, CancellationToken cancellationToken = default)
        {
            using var message = CreateOperationRequest(body);
            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);

            switch (message.Response.Status)
            {
            case 200:
                return(message.Response);

            default:
                throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
            }
        }
        internal HttpMessage CreateOperationRequest(CustomizedModel body)
        {
            var message = _pipeline.CreateMessage();
            var request = message.Request;

            request.Method = RequestMethod.Put;
            var uri = new RawRequestUriBuilder();

            uri.Reset(endpoint);
            uri.AppendPath("/Operation/", false);
            request.Uri = uri;
            request.Headers.Add("Content-Type", "application/json");
            if (body != null)
            {
                using var content = new Utf8JsonRequestContent();
                content.JsonWriter.WriteObjectValue(body);
                request.Content = content;
            }
            return(message);
        }