private void GetEntityAttributes(ref ServiceObject so)
        {
            SourceCode.SmartObjects.Services.ServiceSDK.Objects.Method meth = so.Methods[0];
            //K2CRMHelper helper = new K2CRMHelper();
            WizardFunctions   helper         = new WizardFunctions();
            CRMEntityMetadata entitymetadata = new CRMEntityMetadata();

            entitymetadata.Config = crmconfig;

            try
            {
                entitymetadata.LogicalName       = NotNull(so.Properties["EntityLogicalName"].Value);
                entitymetadata.IncludeAttributes = true;
                RestResponse <CRMEntityMetadata> response = helper.GetEntityMetadata(entitymetadata, config);

                so.Properties.InitResultTable();
                foreach (CRMAttribute ret in response.Data.Attributes)
                {
                    for (int c = 0; c < meth.ReturnProperties.Count; c += 1)
                    {
                        Property prop = so.Properties[meth.ReturnProperties[c]];
                        prop = SetGetEntityAttributeProperties(prop, ret);
                    }
                    so.Properties.BindPropertiesToResultTable();
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }