src/Inflatable/Aspect/ORMAspect.cs
/// <summary>
/// Used to insert code at the beginning of the method
/// </summary>
/// <param name="method">Overridding Method</param>
/// <param name="baseType">Base type</param>
/// <returns>The code to insert</returns>
Used to insert code at the beginning of the method
Used to insert code at the beginning of the method
public string SetupStartMethod(MethodInfo method, Type baseType)
        {
            if (method?.Name.StartsWith("set_", 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 StartMethodHelpers)
                {
                    Helper.Setup(method, Mapping, Builder);
                }
            }
            var Result = Builder.ToString();
            ObjectPool.Return(Builder);
            return Result;
        }
public string SetupStartMethod ( MethodInfo method , Type baseType ) { 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 StartMethodHelpers ) { Helper . Setup ( method , Mapping , Builder ) ; } } var Result = Builder . ToString ( ) ; ObjectPool . Return ( Builder ) ; return Result ; }
Used to insert code at the beginning of the method
Used to insert code at the beginning of the method
The code to insert
The code to insert
method
MethodInfo
None
baseType
Type
None