Questions tagged [icollection]

The ICollection interface is the base interface for classes in the System.Collections namespace. It defines size, enumerators, and synchronization methods for all non-generic collections

The ICollection interface is the base interface for classes in the System.Collections namespace.

The ICollection interface extends IEnumerable; IDictionary and IList are more specialized interfaces that extend ICollection. An IDictionary implementation is a collection of key/value pairs, like the Hashtable class. An IList implementation is a collection of values and its members can be accessed by index, like the ArrayList class.

Some collections that limit access to their elements, such as the Queue class and the Stack class, directly implement the ICollection interface.

If neither the IDictionary interface nor the IList interface meet the requirements of the required collection, derive the new collection class from the ICollection interface instead for more flexibility.

279 questions
0
votes
0 answers

Using Codefluent entitycollection with Infragistics WebHierarchicalDataGrid

I'm looking for some help on binding a Codefluent entitycollection with an Infragistics WebHierarchicalDataGrid (v14.2). For illustrative purposes, I have two Codefluent entities: Customer and Order; where one related customer has many related…
Greg Delaney
  • 81
  • 11
0
votes
4 answers

Collection vs ICollection

I have created a dummy projet for testing collection and ICollection.I have a user class and wanted to create a collection.Example - ICollection users = new Collection(); Collection users = new Collection(); Both code are…
Mohit Kumar
  • 1,885
  • 5
  • 21
  • 24
0
votes
1 answer

Thread safe enumeration, add or removal of a collection in c#

I have faced a question in interview I am not sure I understood it correctly . Would it really be real time scenario?? But I am trying my best to explain the problem Create a class that is to be collection(implement IEnumerable) and it will have a…
Yogesh
  • 3,044
  • 8
  • 33
  • 60
0
votes
1 answer

EF6 seeding via initializer and one-to-many ICollection

I am following the EF6 code first walk-through, and have tried to adapt it slightly to suit my own project, but I have run into a problem when seeding the database with the initializer. I have created 2 classes: A property mode: namespace…
0
votes
0 answers

Updating ICollection

I have this code inside my HTTP PUT Method; var toUpdate = context.MyTableData.SingleOrDefault(a => a.id == someId); id = data.id, name = data.name, age = data.age, JObject otherData = (JObject)data; JToken value;…
Mr.Right
  • 49
  • 8
0
votes
1 answer

Generic Icollection Of

I want to Create Object of Icollection of . My Code is as below. Dim oAttributeValues As ICollection(Of AttributeValue) = TryCast(AttributeValuePropertyInfo.GetValue(UOMEn, Nothing), ICollection(Of…
0
votes
2 answers

Cannot implicitly convert type 'System.Collections.Generic.HashSet'

I am trying to follow the tutorial listed here: Link And when I insert the below code public ApplicationUser() { UserUpload = new HashSet(); } public ICollection UserUpload { get; set; } } into the ApplicationUser class of…
Keith Thomson
  • 63
  • 4
  • 9
0
votes
0 answers

Mapping Icollection on intermediate tables on c#

I'm trying to figure out a way of mapping an icollection into a table but it throws me this errors: Error 1: Cannot implicitly convert type 'System.Collections.Generic.ICollection' to 'elayer.c'. An explicit conversion exists (are you missing a…
Saikios
  • 3,623
  • 7
  • 37
  • 51
0
votes
1 answer

how do i use AutoMapper in ICollation<> Fields

when i use AutoMapper for mapping my ViewModels and get All News, thrown error for me. Errors... The following property on Mosque.Core.ViewModels.CategoryViewModel cannot be mapped: Categories Add a custom mapping expression, ignore, add a custom…
Akbar.Gh
  • 3
  • 2
0
votes
2 answers

ICollection<> inside ICollection<> in Razor - can't retrieve the model names

I'm wondering how to resolve the problem. I'm developing an ASP.NET MVC app I have a models public class SearcherString { public int ID { get; set; } public string Description { get; set; } public virtual ICollection Path { get;…
kamyk
  • 295
  • 8
  • 25
0
votes
1 answer

ICollection Why SerializationBinder is call on HashSet but not on List

I have an object like this : public class MyCollec { public ICollection MyCollection { get; set; } public MyCollec() { MyCollection = new List(); } } In WebApi i had a SerializationBinder, in my…
binard
  • 1,726
  • 1
  • 17
  • 27
0
votes
1 answer

EditorFor ICollection and named Template

i am new to MVC 5 and ASP.NET, EF6 and now i have a Problem with a named EditorTemplate. My Model looks like this: public partial class Product { public int pid { get; set; } public string Name { get; set; } public virtual…
Tomcat
  • 69
  • 1
  • 3
0
votes
4 answers

How to iterate over @Model.ICollection in Java Script function?

I have a @Model.LoginCoordinates where LoginCoordinates is ICollection. The Coordinates class: public class Coordinates { public int Id { get; set; } public double Latitude { get; set; } public double Longitude { get; set;…
Yoda
  • 17,363
  • 67
  • 204
  • 344
0
votes
1 answer

Enumerated list of child class not working

I am creating a webpage for a help desk software where the top shows the information from the ticket class and then the bottom for the ticketNotes that are attached to the ticket class through an ICollection. Currently if I comment out the bottom,…
djblois
  • 963
  • 1
  • 17
  • 52
0
votes
2 answers

Error while implementing IEnumerator

I followed the article here and the sample code given in it. What I am trying to implement is pretty straightfoward. I do have a fair understanding about collections and enumerators. However, what I don't understand is that even though there is…
raring sunny
  • 191
  • 1
  • 3
  • 16