private static void MapExtensionProperties(IAttributeSetInstanceStateDto state, JObject dynamicObject, IDictionary <string, string> propertyFieldDictionary, string nameFormat) { foreach (var p in propertyFieldDictionary) { var propertyName = (nameFormat == null) ? p.Key : String.Format(nameFormat, p.Key); var fieldName = (nameFormat == null) ? p.Value : String.Format(nameFormat, p.Value); var pVal = Dynamic.InvokeGet(state, fieldName); if (pVal != null) { Dynamic.InvokeSet(dynamicObject, propertyName, pVal); } } }
protected override void MapExtensionProperties(IAttributeSetInstanceStateDto state, JObject dynamicObject) { var pDic = AttributeSetService.GetExtensionPropertyFieldDictionary(state.AttributeSetId); MapExtensionProperties(state, dynamicObject, pDic, null); }