I have a C# method that I would like to use to update some data. The method could be passed either a string, a double, an integer
public void Update(string ac, s
EDIT
It looks like you want to pass in a property name, and a value. A little bit of reflection should make this easy:
public void Update(string ac, string pr, string propertyName, object Value) {
try {
vm.Product = _product.Get(ac, pr);
vm.Product.GetType().GetProperty(propertyName).SetValue(vm.Product, value, null);
_product.AddOrUpdate(vm.Product);
}
}
END EDIT
A params array allow your method to accept a variable number of parameters
public void Update(string ac, string pr, params object[] arguments)
Which could be called with any of your examples above
Update("key1", "key2", "location", "London");
Update("key1" , "key2", "beds", 2);
Update("key1" , "key2", "price", 123.45);