Posts

Showing posts from November, 2022

what is difference between Ienumerable and IList in c#

 IList is useful when you want to Add or remove items from the list. IList can find out the no of elements in the collection without iterating the collection. IList supports deferred execution. You use  IEnumerable when you want to loop through the items in a collection . IList is when you want to add, remove, and access the list contents out of order. IList : IList exists in System.Collections Namespace. IList is used to access an element in a specific position/index in a list. Like IEnumerable, IList is also best to query data from in-memory collections like List, Array etc. IList is useful when you want to Add or remove items from the list. IList can find out the no of elements in the collection without iterating the collection. IList supports deferred execution. IList doesn't support further filtering. IEnumerable : IEnumerable exists in System.Collections Namespace. IEnumerable can move forward only over a collection, it can’t move backward and between the items. IEnumera...

Is Entity Framework Thread Safe?

  Entity Framework DB contexts are not thread safe . If an ASP.NET Core app wishes to process requests in a multi-threaded way while using Entity Framework Core, it's important to carefully manage DbContexts so that a single context isn't used on multiple threads simultaneously.

what is ODATA with example ?

Image
OData is the Open Data Protocol. It is an open web protocol started by Microsoft to expose data using existing web technologies. This is based on Representational State Transfer (REST) full architecture. HTTP, AtomPub (similar to RSS, but specifically introduced special XML format for OData), JSON are all supported. Here, the URL is the primary operator on the data query. Example of OData Service has been used: Last (2010) football world cup (S.A), the scoring website was done using an OData Service. Why should we use an OData Service?  OData is based on the REST architecture, so we can retrieve data based on an URL. It also supports HTTP, Atom Pub as well as JSON format. It has support for any type of data source. Even you can use a custom class as a data source. No need to create a proxy service object. So, it is lightweight to use. You can create your own custom methods and expose it. Since it is lightweight, the interaction between server and client is fast. Thus, performance i...