Posts

Showing posts from January, 2012

Are you missing a getter property when binding WPF grid to a Generic List?

Image
I tasked myself couple of days ago to build a sample WCF Service to send a pre-configured auto response based on a specific request.  I initially defined my Data Contract as follows: namespace SampleWCFService {     [DataContract]     public class Book     {         [DataMember]         public string ISBN;         [DataMember]         public string Title;         [DataMember]         public string Author; ...     } } The data contract was streamed over the wire with the code snippet below: public List<Book> Filter(string Author, string Genre, string Title) {     XDocument db = GetData();     List<Book> lstBooks = GetAllBooks();     if (!string.IsNullOrEmpty(Author))     {       lstBooks = lstBooks.Where(book => book.Author == Author).ToList<Book>();     }     if (!string.IsNullOrEmpty(Genre))     {         lstBooks = lstBooks.Where(book => book.Genre == Genre).ToList<Book>();     }     if (!string.IsNullOr