Abhilash J A

Abhilash J A

  • 530
  • 2.4k
  • 598.3k

c# check if list contain value something then assign another

Jan 1 2017 1:19 AM
Hello Everyone,
 
I have datatable with list items. If Fullname usertype is 'Admin' then want output like 'Fullname(Admin)'.
 
Eg: Rajesh(Admin)
 
 
 
  1. objTble_accessLog = dt.AsEnumerable().Select(m => new Tble_accessLog()  
  2.                    {  
  3.                        accessLogId = m.Field("accessLogId"),  
  4.                        FullName = m.Field<string>("FullName"),/* Here, If Fullname usertype is 'Admin' then want output like 'Fullname(Admin)' eg Rajesh(Admin)'*/  
  5.                        AccessDate = m.Field<string>("AccessDate"),  
  6.                        Action = m.Field<string>("Action")                       
  7.                    }).ToList();  
 

Answers (1)