A2BHelperWithoutContextNamespace.HelperExtensionMethods.AElementWithName C# (CSharp) Method

AElementWithName() private method

private AElementWithName ( string name ) : TypeA.IA
name string
return TypeA.IA
        public static TypeA.IA AElementWithName(string name)
        {
            //functional (operational) helper
            return A2BHelperWithoutContext.InputModelContainer.IN.Descendants().OfType<TypeA.IA>().FirstOrDefault(element => element.NameA == name);
        }

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);
            }