{"id":561,"date":"2023-09-08T19:47:09","date_gmt":"2023-09-09T01:47:09","guid":{"rendered":"https:\/\/kop.lat\/blog\/?p=561"},"modified":"2023-09-08T19:47:09","modified_gmt":"2023-09-09T01:47:09","slug":"list-of-20-most-common-interfaces-in-c","status":"publish","type":"post","link":"https:\/\/kop.lat\/blog\/list-of-20-most-common-interfaces-in-c\/","title":{"rendered":"List of 20 Most common Interfaces in C#"},"content":{"rendered":"\n<p><\/p>\n\n\n\n<p>In C#, there are several common interfaces that are widely used for different purposes. Here is a list of some of the most commonly used interfaces in C#:<\/p>\n\n\n\n<ol>\n<li><strong>IEnumerable:<\/strong> Represents a collection that can be enumerated. It is used for iterating over a collection of items.<\/li>\n\n\n\n<li><strong>IEnumerator:<\/strong> Provides methods for iterating over a collection. It is often used in conjunction with <code>IEnumerable<\/code>.<\/li>\n\n\n\n<li><strong>IComparable:<\/strong> Defines a method to compare one object with another object of the same type. Used for custom object comparisons.<\/li>\n\n\n\n<li><strong>IEquatable:<\/strong> Defines a method to determine whether the current object is equal to another object of the same type. Used for custom object equality comparisons.<\/li>\n\n\n\n<li><strong>IDisposable:<\/strong> Provides a mechanism for releasing unmanaged resources. It&#8217;s used for resource management and cleanup.<\/li>\n\n\n\n<li><strong>IList:<\/strong> Represents a non-generic collection of objects that can be individually accessed by index. Common implementations include <code>List&lt;T&gt;<\/code> and <code>ArrayList<\/code>.<\/li>\n\n\n\n<li><strong>ICollection:<\/strong> Defines methods to manipulate generic collections. Common implementations include <code>List&lt;T&gt;<\/code>.<\/li>\n\n\n\n<li><strong>IDictionary:<\/strong> Represents a collection of key-value pairs. Common implementations include <code>Dictionary&lt;TKey, TValue&gt;<\/code>.<\/li>\n\n\n\n<li><strong>INotifyPropertyChanged:<\/strong> Used in data binding scenarios to notify clients when a property value changes.<\/li>\n\n\n\n<li><strong>INotifyCollectionChanged:<\/strong> Used in data binding scenarios to notify clients when a collection changes, such as items being added or removed.<\/li>\n\n\n\n<li><strong>IQueryable:<\/strong> Represents a queryable data source. It&#8217;s used in LINQ (Language Integrated Query) for querying collections and databases.<\/li>\n\n\n\n<li><strong>IQueryable:<\/strong> A generic version of <code>IQueryable<\/code>, used for strongly-typed queries in LINQ.<\/li>\n\n\n\n<li><strong>ISerializable:<\/strong> Used for custom serialization of objects. Allows objects to control how they are serialized and deserialized.<\/li>\n\n\n\n<li><strong>IAsyncResult:<\/strong> Represents the status of an asynchronous operation.<\/li>\n\n\n\n<li><strong>IFormattable:<\/strong> Provides a way to format the value of an object into a string representation using a specified format.<\/li>\n\n\n\n<li><strong>ICloneable:<\/strong> Defines a method to create a shallow copy of an object. It&#8217;s used for creating copies of objects.<\/li>\n\n\n\n<li><strong>IConvertible:<\/strong> Provides methods for converting an object to different data types. It&#8217;s used for type conversion.<\/li>\n\n\n\n<li><strong>IComparable:<\/strong> A generic version of <code>IComparable<\/code>, used for comparing objects of a specific type.<\/li>\n\n\n\n<li><strong>IEquatable:<\/strong> A generic version of <code>IEquatable<\/code>, used for determining equality of objects of a specific type.<\/li>\n\n\n\n<li><strong>IAsyncEnumerable:<\/strong> Introduced in C# 8.0, it represents an asynchronous stream of data.<\/li>\n<\/ol>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In C#, there are several common interfaces that are widely used for different purposes. Here is a list of some of the most commonly used interfaces in C#:<\/p>\n","protected":false},"author":1,"featured_media":457,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1,51,97,56,52,12],"tags":[53,18,54],"_links":{"self":[{"href":"https:\/\/kop.lat\/blog\/wp-json\/wp\/v2\/posts\/561"}],"collection":[{"href":"https:\/\/kop.lat\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kop.lat\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kop.lat\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kop.lat\/blog\/wp-json\/wp\/v2\/comments?post=561"}],"version-history":[{"count":1,"href":"https:\/\/kop.lat\/blog\/wp-json\/wp\/v2\/posts\/561\/revisions"}],"predecessor-version":[{"id":562,"href":"https:\/\/kop.lat\/blog\/wp-json\/wp\/v2\/posts\/561\/revisions\/562"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kop.lat\/blog\/wp-json\/wp\/v2\/media\/457"}],"wp:attachment":[{"href":"https:\/\/kop.lat\/blog\/wp-json\/wp\/v2\/media?parent=561"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kop.lat\/blog\/wp-json\/wp\/v2\/categories?post=561"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kop.lat\/blog\/wp-json\/wp\/v2\/tags?post=561"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}