|
-
May 14th, 2012, 02:12 PM
#1
Key from List of EnumeratedValues
Hi,
I am beginner in c#. I have List of EnumeratedValues, I need to get the key and assign to some other string. Can anybody help me on this.
Thanks,
Genith
-
May 14th, 2012, 02:32 PM
#2
Re: Key from List of EnumeratedValues
Can you post some code on what you have?
-
May 14th, 2012, 02:54 PM
#3
Re: Key from List of EnumeratedValues
Hi Arjay,
Here is my EnumeratedValue
public class EnumeratedValue
{
public string ParentKey { get; set; }
public string Value { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public string Type { get; set; }
public string Key { get; set; }
public string ParentType { get; set; }
}
I am already using Name from Store proc.
public List<EnumeratedValue> AvailabeNames
{
}
I am assigning for this AvailabeNames in service. I need to access key form AvailabeNames.
Thanks
-
May 14th, 2012, 05:30 PM
#4
Re: Key from List of EnumeratedValues
Code:
foreach( var availableName in AvailableNames)
{
var key availableName.Key;
}
If you want to find an AvailableName entry by a key, then you may want to use a Dictionary<> collection instead of a List<>.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|