/// <summary> /// From the serializable. /// </summary> /// <param name="memberInitExpressionRepresentation">The memberInit expression.</param> /// <returns> /// Converted expression. /// </returns> public static MemberInitExpression FromRepresentation( this MemberInitExpressionRepresentation memberInitExpressionRepresentation) { if (memberInitExpressionRepresentation == null) { throw new ArgumentNullException(nameof(memberInitExpressionRepresentation)); } var newExpression = memberInitExpressionRepresentation.NewExpressionRepresentation.FromRepresentation(); var bindings = memberInitExpressionRepresentation.Bindings.FromRepresentation(); var result = Expression.MemberInit(newExpression, bindings); return(result); }
/// <summary> /// Converts to serializable. /// </summary> /// <param name="memberInitExpression">The memberInit expression.</param> /// <returns> /// Serializable expression. /// </returns> public static MemberInitExpressionRepresentation ToRepresentation( this MemberInitExpression memberInitExpression) { if (memberInitExpression == null) { throw new ArgumentNullException(nameof(memberInitExpression)); } var type = memberInitExpression.Type.ToRepresentation(); var newExpression = memberInitExpression.NewExpression.ToRepresentation(); var bindings = memberInitExpression.Bindings.ToRepresentation(); var result = new MemberInitExpressionRepresentation(type, newExpression, bindings); return(result); }