Language of integrated query – Part Two

So i am back again to explain some of the flexilibilities offered by LINQ.
The seires is not really related other than the LINQ part but if you are still curious here is the link to part one.
So today i am going to talk on fluent apis. Now the terminology actually came from ruby rails where its easy to read the code and you dont have to add /read comments.
If you check the code here in the method ‘Speak’ we are create two variables and passing them to a ‘talk’ function. There is no way of telling here what the code is doing unless we read it closely. But we can re write the following class to
public class NoneFluentAPI
		{
			private List<string> languages = new List<string>();
 
			public NoneFluentAPI()
			{
				languages.Add("English");
				languages.Add("Swedish");
			}
 
			private void talk(string l1, string l2)
			{
				Console.WriteLine("i am talking from " + l1 + " to " + l2);
			}
 
			public void Speak()
			{
				var l1 = languages[0];
				var l2 = languages[1];
				talk(l1,l2);
			}
 
		}
this ‘FluentAPI’. Now if you see the ‘Speak’ function you can easily see that we have written code to call the talk method from language ‘english’ to ‘swedish’. So if you want to write code like this “from().to()” then the method should return the same object type.
public class FluentAPI
		{
			private List<string> languages = new List<string>();
			private string _toLanguage;
			private string _fromLanguage;
		
 
			public FluentAPI()
			{
				languages.Add("English");
				languages.Add("Swedish");
			}
 
			private void talk()
			{
				Console.WriteLine("i am talking from " + _fromLanguage + " to " + _toLanguage);
			}
 
			public void Speak()
			{
				from("english").to("swedish").talk();
				
			}
 
			private FluentAPI to(string toLanguage)
			{
				_toLanguage = languages.Where(x => x.Equals(toLanguage)).FirstOrDefault();
				return this;
			}
 
			private FluentAPI @from(string fromLanguage)
			{
				_fromLanguage = languages.Where(x => x.Equals(fromLanguage)).FirstOrDefault();
				return this;
			}
		}