/// <summary> /// Patch changes /// </summary> /// <param name="source"></param> /// <param name="target"></param> public static void Patch(this dataModel.OperationPropertyEntity source, dataModel.OperationPropertyEntity target) { if (target == null) throw new ArgumentNullException("target"); var patchInjectionPolicy = new PatchInjection<dataModel.OperationPropertyEntity>(x => x.BooleanValue, x => x.DateTimeValue, x => x.DecimalValue, x => x.IntegerValue, x => x.Locale, x => x.LongTextValue, x => x.ShortTextValue, x => x.ValueType); target.InjectFrom(patchInjectionPolicy, source); }
private static void SetPropertyValue(dataModel.OperationPropertyEntity retVal, coreModel.OperationProperty property) { switch (property.ValueType) { case coreModel.PropertyValueType.Boolean: retVal.BooleanValue = Convert.ToBoolean(property.Value); break; case coreModel.PropertyValueType.DateTime: retVal.DateTimeValue = Convert.ToDateTime(property.Value); break; case coreModel.PropertyValueType.Decimal: retVal.DecimalValue = Convert.ToDecimal(property.Value); break; case coreModel.PropertyValueType.Integer: retVal.IntegerValue = Convert.ToInt32(property.Value); break; case coreModel.PropertyValueType.LongText: retVal.LongTextValue = Convert.ToString(property.Value); break; case coreModel.PropertyValueType.ShortText: retVal.ShortTextValue = Convert.ToString(property.Value); break; } }