src/Inflatable/Aspect/ORMAspect.cs
/// <summary>
/// Used to insert code at the end of the method
/// </summary>
/// <param name="method">Overridding Method</param>
/// <param name="baseType">Base type</param>
/// <param name="returnValueName">Local holder for the value returned by the function</param>
/// <returns>The code to insert</returns>
Used to insert code at the end of the method
Used to insert code at the end of the method
public string SetupEndMethod(MethodInfo method, Type baseType, string returnValueName)
        {
            if (method?.Name.StartsWith("get_", StringComparison.Ordinal) != true)
                return string.Empty;
            var Builder = ObjectPool.Get();
            foreach (var (Source, ParentType) in ClassManager.Sources.Where(x => x.ConcreteTypes.Contains(baseType))
                .SelectMany(Source => Source.ParentTypes[baseType]
                .Select(ParentType => (Source, ParentType))))
            {
                var Mapping = Source.Mappings[ParentType];
                foreach (var Helper in EndMethodHelpers)
                {
                    Helper.Setup(returnValueName, method, Mapping, Builder);
                }
            }
            var Result = Builder.ToString();
            ObjectPool.Return(Builder);
            return Result;
        }
public string SetupEndMethod ( MethodInfo method , Type baseType , string returnValueName ) { if ( method ? . Name . StartsWith ( " " , StringComparison . Ordinal ) != true ) return string . Empty ; var Builder = ObjectPool . Get ( ) ; foreach ( var ( Source , ParentType ) in ClassManager . Sources . Where ( x => x . ConcreteTypes . Contains ( baseType ) ) . SelectMany ( Source => Source . ParentTypes [ baseType ] . Select ( ParentType => ( Source , ParentType ) ) ) ) { var Mapping = Source . Mappings [ ParentType ] ; foreach ( var Helper in EndMethodHelpers ) { Helper . Setup ( returnValueName , method , Mapping , Builder ) ; } } var Result = Builder . ToString ( ) ; ObjectPool . Return ( Builder ) ; return Result ; }
Used to insert code at the end of the method
Used to insert code at the end of the method
The code to insert
The code to insert
method
MethodInfo
None
baseType
Type
None
returnValueName
string
Local holder for the value returned by the function
Local holder for the value returned by the function