.net - List<Customer> all or nothing -
I am creating a webservice using the Windows Communication Foundation (WCF) and I do not know the best way to verify What is the way
I have two ways: CreateCustomer (Customer) and CreateCustomers (list & lt; Customer & gt;) .
If a customer passes into the customer list, and some customers are invalid, should I reject the full request? Or should I return those people who pass verification and label those people who were invalid?
Or, do I call them only if they want to call CreateCustomer (Customer) method and repeatedly if they want more than one customer?
In this case, I would suggest a transaction like the approach.
Actually, you will agree to all, if they do not pass, throw exceptions, or other validity failing events, the identity of the customer who did not pass or used real objects The person will allow the other side of the pipeline to identify the problems.
To save the database, I will try to do this in a transaction, partly saving 1-7 customers, but no 8th may be the reason.
Comments
Post a Comment