A2BHelperWithoutContextNamespace.HelperExtensionMethods.FirstAElement C# (CSharp) Method

FirstAElement() public static method

public static FirstAElement ( ) : TypeA.IA
return TypeA.IA
        public static TypeA.IA FirstAElement()
        {
            //attribute helper
            return A2BHelperWithoutContext.InputModelContainer.IN.Descendants().OfType<TypeA.IA>().FirstOrDefault();
        }

Usage Example

Example #1
0
            public override void DeclareSynchronization()
            {
                SynchronizeLeftToRightOnly(
                    s => s.NameB + HelperExtensionMethods.NameExtension(),
                    t => t.Name);

                SynchronizeLeftToRightOnly(SyncRule <RuleA>(),
                                           s => HelperExtensionMethods.FirstAElement(),
                                           t => t.FirstAElement.FirstOrDefault(),
                                           null);

                SynchronizeLeftToRightOnly(SyncRule <RuleA>(),
                                           s => HelperExtensionMethods.AElementWithName("ABC"),
                                           t => t.AElementWithName.FirstOrDefault(),
                                           null);

                SynchronizeManyLeftToRightOnly(SyncRule <RuleA>(),
                                               s => s.Elms,
                                               t => t.Elms);
            }