mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-10-08 21:40:21 +00:00
Added documentation
This commit is contained in:
parent
736e8ce42c
commit
e48eccd19f
@ -6,6 +6,15 @@ public static class ExpressionExtensions
|
||||
{
|
||||
private static readonly ILogger LOGGER = Program.LOGGER_FACTORY.CreateLogger(typeof(ExpressionExtensions));
|
||||
|
||||
/// <summary>
|
||||
/// Extracts the member expression from a given lambda expression representing a property.
|
||||
/// </summary>
|
||||
/// <param name="expression">A lambda expression specifying the property for which the member expression is to be extracted.
|
||||
/// The lambda expression body must represent member access.</param>
|
||||
/// <typeparam name="TIn">The type of the object containing the property referenced in the lambda expression.</typeparam>
|
||||
/// <typeparam name="TOut">The type of the property being accessed in the lambda expression.</typeparam>
|
||||
/// <returns>The member expression that represents the property access.</returns>
|
||||
/// <exception cref="ArgumentException">Thrown if the provided lambda expression does not represent a valid property expression.</exception>
|
||||
public static MemberExpression GetMemberExpression<TIn, TOut>(this Expression<Func<TIn, TOut>> expression)
|
||||
{
|
||||
switch (expression.Body)
|
||||
|
Loading…
Reference in New Issue
Block a user