I decided to take a quick look at the LINQ side of things, and not just use the direct foreach loop, but I had problems with its operation, mainly because of the data types that I consider.
So I have it,
var selectedSiteType = from sites in siteTypeList where sites.SiteTypeID == temp select sites;
siteTypeList is a list of SiteTypes. I am trying to find a specific one (which I denounced with the variable "temp".
How can I use this selected SiteType AS SiteType? When I try to pass "selectedSiteType" through another function, for example:
mSiteTypeSub.EditSitetype(selectedSiteType);
note: I tried to provide an index as if selectedSiteType was a list / array, but that didn't work either, I get the following error:
Argument 1: cannot convert from 'System.Collections.Generic.IEnumerable<DeviceManager_take_2.SiteType>' to 'DeviceManager_take_2.SiteType'
Am I missing something? perhaps some garbage? As if I said that I am new to this, and I am struggling to solve it. Most likely I have the whole concept wrong, and bingbangbosh I made myself a fool!
Greetings in advance.
Shane.c
source share