I am trying to create my own EasyBinderDropDown, which currently looks like this:
public class EasyBinderDropDown : DropDownList, ICanBindToObjectsKeyValuePair {
public void BindToProperties<TYPE_TO_BIND_TO>(IEnumerable<TYPE_TO_BIND_TO>
bindableEnumerable,
Expression<Func<TYPE_TO_BIND_TO, object>> textProperty,
Expression<Func<TYPE_TO_BIND_TO, object>> valueProperty) {...}
public bool ShowSelectionPrompt { get; set; }
public string SelectionPromptText { get; set; }
public string SelectionPromptValue { get; set; }
}
Basically, this is very useful for simple binding to objects from the internal code, since you are just doing something like _dropDown.BindToProperties (myCustomers, c => c.Name, c => c.Id), and it works for you. also setting ShowSelectionPrompt and SelectionPromptText. I can easily get the line "Select customer". I donβt want to ask so much about my specific implementation; rather, I am confused how to write unit tests for some scenarios.
, , , , , . - , ? HTTPContext - , ?