Last post Jan 24, 2013 04:38 AM by ankit.sri
Jan 24, 2013 02:12 AM|bharatmishra1981|LINK
Say I have a WCF service with Data contract as 'Customer'
Now I have a service method like
public List<Customer> GetAllCustomers();
OR I can have a service method like this:
public stirng GetAllCustomers_JsonString(); --- this method will return a json string of list of 'Customer'
Which one is better and why.
Jan 24, 2013 04:38 AM|ankit.sri|LINK
Depends on situation JSON is lightwieght and will hold less memory where as a DataContract Object may be heavy. If you use JSON you will need to make sure it it require Serialization and DeSerialization and may consume some time.