Question: I have installed a VIOS using nimol, install completed successfully but I could access the VIOS from browser.

I am seeing the following error.

```
# /usr/bin/ksh /usr/ios/lpm/sbin/httpdmgr start
ready=12
Error: This is not a management partition.
Done

```

Answer: 
This:

```
var query = (from RESTAURANT in db.RESTAURANTs
             where RESTAURANT.REST_ID == RestID
             select new { name = RESTAURANT.name});

```

defines a *query*. When your program is running, and this line has been processed, the `query` variable refers to a query instance. The database has not yet been invoked.

If you append (for instance) `.ToList()` to your statement like this:

```
var query = (from RESTAURANT in db.RESTAURANTs
             where RESTAURANT.REST_ID == RestID
             select new { name = RESTAURANT.name}).ToList();

```

Then `query` will contain a list of items that were fetched from the database. But still in this case, the type of the items in the list is an anonymous type, so you still cannot change the `var` to a named type. If you want that then you need to have the query return a known named type. Like this:

```
List<string> query = (from RESTAURANT in db.RESTAURANTs
             where RESTAURANT.REST_ID == RestID
             select RESTAURANT.name).ToList();

```

or maybe like this:

```
public class Restaurant 
{
    public string Name {get; set;}
}

List<Restaurant> query = (from RESTAURANT in db.RESTAURANTs
             where RESTAURANT.REST_ID == RestID
             select new Restaurant() { Name = name }).ToList();

```
No need to declare `query` separately, 
use [?:operator](https://msdn.microsoft.com/en-us/library/ty67wk28.aspx) `var query = <condition> ? <1st Linq query> : <2nd Linq query>` instead of `if-else`
you can do this like that:

```
var query =  string.IsNullOrEmpty(dealer_code) ?  
             (from RESTAURANT in db.RESTAURANTs
             where RESTAURANT.REST_ID == RestID
             select new { name = RESTAURANT.name}):
             (from u in db.RESTAURANTs
             where u.dealer_code == dealer_code
             select new { name = u.name});

```