Class VendorCollection
Represents a collection of Vendors.
public class VendorCollection : IEnumerable<KeyValuePair<int, Vendor>>, IEnumerable
Implements:
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.Int32,Bidtellect.Tcf.Models.Components.VendorList.Vendor>>
, System.Collections.IEnumerable
Properties
Ids
Gets an enumerable collection of the Vendor IDs contained in this collection.
public IEnumerable<int> Ids { get; }
Count
Gets the number of elements contained in this collection.
public int Count { get; }
Fields
vendors
protected Dictionary<int, Vendor> vendors
Methods
Add(Vendor)
Adds a Vendor to this collection.
public void Add(Vendor vendor)
Parameters
Type | Name | Description |
---|---|---|
Bidtellect.Tcf.Models.Components.VendorList.Vendor | vendor | The Vendor to be added. |
Exceptions
System.ArgumentException
System.ArgumentOutOfRangeException
Add(int)
Adds a Vendor to this collection.
public void Add(int vendorId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | vendorId | The ID of the Vendor. |
Exceptions
System.ArgumentException
System.ArgumentOutOfRangeException
Add(int, Vendor)
Adds a Vendor to this collection.
public void Add(int vendorId, Vendor vendor)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | vendorId | The ID of the Vendor. |
Bidtellect.Tcf.Models.Components.VendorList.Vendor | vendor | The Vendor to be added. |
Exceptions
System.ArgumentException
System.ArgumentOutOfRangeException
Remove(int)
Removes a Vendor with the given Vendor ID from this collection.
public bool Remove(int vendorId)
Returns
System.Boolean
: A value indicating whether the Vendor was successfully found and removed.
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | vendorId | The ID of the Vendor. |
Remove(Vendor)
Removes a Vendor from this collection.
public bool Remove(Vendor vendor)
Returns
System.Boolean
: A value indicating whether the Vendor was successfully found and removed.
Parameters
Type | Name | Description |
---|---|---|
Bidtellect.Tcf.Models.Components.VendorList.Vendor | vendor | The Vendor to be removed. |
Exceptions
System.ArgumentNullException
Contains(int)
Determines whether the collection contains a Vendor with the given ID.
public bool Contains(int vendorId)
Returns
System.Boolean
: true
if this collection contains a Vendor with the given ID;
otherwise, false
.
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | vendorId | The ID of the Vendor. |
TryGet(int, out Vendor)
Gets a Vendor with the given ID.
public bool TryGet(int vendorId, out Vendor vendor)
Returns
System.Boolean
: true
if this collection contains a Vendor with the given ID;
otherwise, false
.
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | vendorId | The ID of the Vendor. |
Bidtellect.Tcf.Models.Components.VendorList.Vendor | vendor | When this method returns, contains the Vendor, |
if the ID is found; otherwise, null . | ||
This parameter is passed uninitialized. |
GetEnumerator()
Returns an enumerator that iterates through the collection.
public IEnumerator<KeyValuePair<int, Vendor>> GetEnumerator()
Returns
System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<System.Int32,Bidtellect.Tcf.Models.Components.VendorList.Vendor>>
: An enumerator that can be used to iterate through the collection.
Implements
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.Int32,Bidtellect.Tcf.Models.Components.VendorList.Vendor>>
System.Collections.IEnumerable