Question: Why is time taken to access an element in a non-homogeneous list considered as constant or How is a non-homogeneous list stored in memory in case of python?

In case of a homogeneous list, knowing the type and position, the memory location can be determined but how is it done in case of a non homogeneous list so fast as to consider it as a function of constant time?

Going through this page [Does Python use linked lists for lists? Why is inserting slow?](https://stackoverflow.com/questions/12274060/does-python-use-linked-lists-for-lists-why-is-inserting-slow) I assume it stores elements in contiguous memory locations.

Answer: 
If all you need to do is check the value of a boolean, that's just a conditional statement:

```
public JsonResult ResolveProfileSelectionRequired(ResolveProfileSelectionRequiredModel model)
{
    if (model.NewTransferee)
    {
        // do something
    }
    else
    {
        // do something else
    }
}

```

It's not entirely clear what your goal is though, since your current `return` statement depends on the output of the method that you only want to call conditionally. All code paths will need to return *something*. Maybe like this?:

```
public JsonResult ResolveProfileSelectionRequired(ResolveProfileSelectionRequiredModel model)
{
    if (model.NewTransferee)
    {
        var resolved = SqlDataProvider.ResolveProfileSelectionRequiredJobException(model);

        return resolved ? Json("Success") : Json("Failed");
    }
    else
    {
        return Json("Success");
    }
}

```

Again, I can't know without knowing more about your intended behavior for this action.

It's worth noting that this isn't really an "MVC" thing. At its simplest, this action method is just a method which receives an argument of type `ResolveProfileSelectionRequiredModel`. The conditional statement is just plain C#. All code paths returning a value is plain C#. The only thing "MVC" about this method is that it's returning a `JsonResult`.

---

**Edit:** I just noticed... The value you're looking for is on the `CreateTransferee` model, but your controller is receiving a `ResolveProfileSelectionRequiredModel`? Is that value on the `ResolveProfileSelectionRequiredModel`? They seem to be very similar. If it's not on that model, you can either add it to that model or use @Raidri's approach to add it as an explicit parameter to the controller action.
Expand your controller action with a new parameter:

```
public JsonResult ResolveProfileSelectionRequired(ResolveProfileSelectionRequiredModel model, bool newtransferee = false)

```

and check it inside the action.