@@ -262,6 +262,22 @@ public string GetEntityUpdateAsyncMethod(OdcmClass odcmClass)
262262// Build select and expand methods
263263// -------------------------------------------------------------
264264
265+ public string GetExpandExpressionMethod(string requestType, string underlyingType)
266+ {
267+ var stringBuilder = new StringBuilder();
268+
269+ stringBuilder.Append(
270+ @"/// <summary>
271+ /// Adds the specified expand value to the request.
272+ /// </summary>
273+ /// <param name=""expandExpression"">The expression from which to calculate the expand value.</param>
274+ /// <returns>The request object to send.</returns>");
275+ stringBuilder.Append(Environment.NewLine);
276+ stringBuilder.AppendFormat(" I{0} Expand(Expression<Func<{1}, object>> expandExpression);", requestType, underlyingType);
277+
278+ return stringBuilder.ToString();
279+ }
280+
265281public string GetExpandMethod(string entityRequest)
266282{
267283 var stringBuilder = new StringBuilder();
@@ -274,7 +290,22 @@ public string GetExpandMethod(string entityRequest)
274290 /// <returns>The request object to send.</returns>");
275291 stringBuilder.Append(Environment.NewLine);
276292 stringBuilder.AppendFormat(" I{0} Expand(string value);", entityRequest);
277- stringBuilder.Append("TODO ExpandExpression");
293+
294+ return stringBuilder.ToString();
295+ }
296+
297+ public string GetSelectExpressionMethod(string requestType, string underlyingType)
298+ {
299+ var stringBuilder = new StringBuilder();
300+
301+ stringBuilder.Append(
302+ @"/// <summary>
303+ /// Adds the specified select value to the request.
304+ /// </summary>
305+ /// <param name=""selectExpression"">The expression from which to calculate the select value.</param>
306+ /// <returns>The request object to send.</returns>");
307+ stringBuilder.Append(Environment.NewLine);
308+ stringBuilder.AppendFormat(" I{0} Select(Expression<Func<{1}, object>> selectExpression);", requestType, underlyingType);
278309
279310 return stringBuilder.ToString();
280311}
@@ -291,31 +322,42 @@ public string GetSelectMethod(string entityRequest)
291322 /// <returns>The request object to send.</returns>");
292323 stringBuilder.Append(Environment.NewLine);
293324 stringBuilder.AppendFormat(" I{0} Select(string value);", entityRequest);
294- stringBuilder.Append("TODO SelectExpression");
295325
296326 return stringBuilder.ToString();
297327}
298328
299329// Standard entity
300330public string GetEntityExpandMethods(OdcmClass odcmClass)
301331{
302- return this.GetExpandMethod(this.GetRequestString(this.GetEntityNameString(odcmClass)));
332+ string entityName = this.GetEntityNameString(odcmClass);
333+ return this.GetExpandMethod(this.GetRequestString(entityName)) +
334+ Environment.NewLine + Environment.NewLine + " " +
335+ this.GetExpandExpressionMethod(this.GetRequestString(entityName), entityName);
303336}
304337
305338public string GetEntitySelectMethods(OdcmClass odcmClass)
306339{
307- return this.GetSelectMethod(this.GetRequestString(this.GetEntityNameString(odcmClass)));
340+ string entityName = this.GetEntityNameString(odcmClass);
341+ return this.GetSelectMethod(this.GetRequestString(entityName)) +
342+ Environment.NewLine + Environment.NewLine + " " +
343+ this.GetSelectExpressionMethod(this.GetRequestString(entityName), entityName);
308344}
309345
310346// Entity with references
311347public string GetEntityWithReferenceExpandMethods(OdcmClass odcmClass)
312348{
313- return this.GetExpandMethod(this.GetEntityWithReferenceRequestName(odcmClass));
349+ string entityWithReferenceRequestName = this.GetEntityWithReferenceRequestName(odcmClass);
350+ return this.GetExpandMethod(entityWithReferenceRequestName) +
351+ Environment.NewLine + Environment.NewLine + " " +
352+ this.GetExpandExpressionMethod(entityWithReferenceRequestName, this.GetEntityNameString(odcmClass)););
314353}
315354
316355public string GetEntityWithReferenceSelectMethods(OdcmClass odcmClass)
317356{
318- return this.GetSelectMethod(this.GetEntityWithReferenceRequestName(odcmClass));
357+ string entityWithReferenceRequestName = this.GetEntityWithReferenceRequestName(odcmClass);
358+ return this.GetSelectMethod(entityWithReferenceRequestName) +
359+ Environment.NewLine + Environment.NewLine + " " +
360+ this.GetSelectExpressionMethod(entityWithReferenceRequestName, this.GetEntityNameString(odcmClass)););}
319361}
320362
321363#>
0 commit comments