Search code examples
c#fluent-interface

How to create Find.Elements.By.Name(string name) in fluent API design?


Is this possible to create something like Find.Elements.By.Name(string name) using fluent api design pattern in c#? If so, how?


Solution

  • A way to implement this:

        public class Find
        {
            public struct Elements
            {
                public struct By
                {
                    public static WindowsElement Name(string name)
                    {
                        // code here
                    }
                }
            }
        }