Example #1
0
 private void AddPropertyUpdates(ICommand command)
 {
     foreach (KeyValuePair <string, object> propertyUpdate in this.propertyUpdates)
     {
         Func <ResourceProperty, bool> func          = null;
         KeyValuePair <string, object> keyValuePair1 = propertyUpdate;
         if (!command.CanFieldBeAdded(keyValuePair1.Key))
         {
             continue;
         }
         KeyValuePair <string, object> keyValuePair2 = propertyUpdate;
         object value = keyValuePair2.Value;
         value = EntityUpdate.ResolveUpdatableObject(value);
         value = EntityUpdate.ResolveUpdatableObjectList(value);
         if (value == null && this.commandType == CommandType.Create)
         {
             ReadOnlyCollection <ResourceProperty> properties = this.resourceType.Properties;
             if (func == null)
             {
                 func = (ResourceProperty item) => {
                     KeyValuePair <string, object> keyValuePair = propertyUpdate;
                     return(item.Name == keyValuePair.Key);
                 }
                 ;
             }
             ResourceProperty resourceProperty = properties.First <ResourceProperty>(func);
             if (resourceProperty.ResourceType.IsNullable())
             {
                 continue;
             }
         }
         KeyValuePair <string, object> keyValuePair3 = propertyUpdate;
         command.AddFieldParameter(keyValuePair3.Key, value);
     }
 }
Example #2
0
		private void AddPropertyUpdates(ICommand command)
		{
			foreach (KeyValuePair<string, object> propertyUpdate in this.propertyUpdates)
			{
				Func<ResourceProperty, bool> func = null;
				KeyValuePair<string, object> keyValuePair1 = propertyUpdate;
				if (!command.CanFieldBeAdded(keyValuePair1.Key))
				{
					continue;
				}
				KeyValuePair<string, object> keyValuePair2 = propertyUpdate;
				object value = keyValuePair2.Value;
				value = EntityUpdate.ResolveUpdatableObject(value);
				value = EntityUpdate.ResolveUpdatableObjectList(value);
				if (value == null && this.commandType == CommandType.Create)
				{
					ReadOnlyCollection<ResourceProperty> properties = this.resourceType.Properties;
					if (func == null)
					{
						func = (ResourceProperty item) => {
							KeyValuePair<string, object> keyValuePair = propertyUpdate;
							return item.Name == keyValuePair.Key;
						}
						;
					}
					ResourceProperty resourceProperty = properties.First<ResourceProperty>(func);
					if (resourceProperty.ResourceType.IsNullable())
					{
						continue;
					}
				}
				KeyValuePair<string, object> keyValuePair3 = propertyUpdate;
				command.AddFieldParameter(keyValuePair3.Key, value);
			}
		}