internal static unsafe ServiceGroupTypeDescription CreateFromNative(IntPtr descriptionPtr)
        {
            NativeTypes.FABRIC_SERVICE_GROUP_TYPE_DESCRIPTION *nativeDescription = (NativeTypes.FABRIC_SERVICE_GROUP_TYPE_DESCRIPTION *)descriptionPtr;

            ServiceGroupTypeDescription description = new ServiceGroupTypeDescription();

            description.ServiceTypeDescription = ServiceTypeDescription.CreateFromNative(nativeDescription->Description);

            bool isStateful = (description.ServiceTypeDescription.ServiceTypeKind == ServiceDescriptionKind.Stateful);

            NativeTypes.FABRIC_SERVICE_GROUP_TYPE_MEMBER_DESCRIPTION_LIST *nativeMemberList = (NativeTypes.FABRIC_SERVICE_GROUP_TYPE_MEMBER_DESCRIPTION_LIST *)nativeDescription->Members;
            for (int i = 0; i < nativeMemberList->Count; ++i)
            {
                description.Members.Add(ServiceGroupTypeMemberDescription.CreateFromNative(nativeMemberList->Items + (i * Marshal.SizeOf(typeof(NativeTypes.FABRIC_SERVICE_GROUP_TYPE_MEMBER_DESCRIPTION))), isStateful));
            }

            description.UseImplicitFactory = NativeTypes.FromBOOLEAN(nativeDescription->UseImplicitFactory);

            return(description);
        }
        internal static unsafe ServiceGroupTypeMemberDescription CreateFromNative(IntPtr descriptionPtr, bool isStateful)
        {
            NativeTypes.FABRIC_SERVICE_GROUP_TYPE_MEMBER_DESCRIPTION *nativeDescription = (NativeTypes.FABRIC_SERVICE_GROUP_TYPE_MEMBER_DESCRIPTION *)descriptionPtr;

            ServiceGroupTypeMemberDescription description = new ServiceGroupTypeMemberDescription()
            {
                ServiceTypeName = NativeTypes.FromNativeString(nativeDescription->ServiceTypeName)
            };

            NativeTypes.FABRIC_SERVICE_LOAD_METRIC_DESCRIPTION_LIST *nativeMetrics = (NativeTypes.FABRIC_SERVICE_LOAD_METRIC_DESCRIPTION_LIST *)nativeDescription->LoadMetrics;

            if (nativeMetrics != null && nativeMetrics->Count > 0)
            {
                for (int i = 0; i < nativeMetrics->Count; ++i)
                {
                    description.loadMetrics.Add(ServiceLoadMetricDescription.CreateFromNative(nativeMetrics->Items + (i * Marshal.SizeOf(typeof(NativeTypes.FABRIC_SERVICE_LOAD_METRIC_DESCRIPTION))), isStateful));
                }
            }

            return(description);
        }