Use of yield in C#

Normally, when we need to fetch the items from a collection we might create a temporary list to hold the retrieved items and return. But the use of yield, we can get a collection without the use of the temporary collection. Following is the simple example to retrieve list using return a temporary list. Here tmplist is used to store…

Continue Reading

Use Indexer in C#

Indexer helps to make an interface to the class easy way and get so many benefits from that we will understand indexer with an example. We are using classes with an aggregated or a composed collection of objects. For an example here, there are two classes Customer and Address. Customer has addresses and so we have to initialize objects of…

Continue Reading

Dynamic C# with using ExpandoObject and ElasticObject

C# Dynamic It is the class that implements DLR(Dynamic Language Runtime) Interface and now you have a question that what is DLR? The dynamic language runtime (DLR) is a runtime environment that adds a set of services for dynamic languages to the common language runtime (CLR). The DLR makes it easier to develop dynamic languages to run on the .NET…

Continue Reading

MongoDB with .Net and C#

MongoDB MongoDB is an open-source document database and leading NoSQL database. MongoDB is written in c++.  MongoDB is a cross-platform, document-oriented database that provides, high performance, high availability, and easy scalability. MongoDB works on the concept of collection and document. The database is a physical container for collections. Each database gets its own set of files on the file system.…

Continue Reading