c# first item i list
var first_item = list.First();
c# select first value from list
lstComp.First();
//You can also use FirstOrDefault() just in case lstComp does not contain any items.
//To get the Component Value:
var firstElement = lstComp.First().ComponentValue("Dep");
//This would assume there is an element in lstComp. An alternative and safer way would be...
var firstOrDefault = lstComp.FirstOrDefault();
if (firstOrDefault != null)
{
var firstComponentValue = firstOrDefault.ComponentValue("Dep");
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us