I am creating a webservice using Windows Communication Foundation (WCF) and I currently don't know what the best way to do validation with it is.
I have two methods: CreateCustomer(Customer)
and CreateCustomers(List<Customer>)
.
If a client passes in a list of customers, and some of the customers are invalid, should I reject the entire request? Or should I return the ones that passed validation and label the ones that were invalid?
Or, should I only allow them to call the CreateCustomer(Customer)
method and make them repeatedly call it if they want to create more than one customer?