New answers tagged


Because Microsoft decided to only support properties in Entity Framework. There are many reasons why properties are preferred over public fields, but I'll just mention the one that I think is most relevant here: changing from public fields to properties (if the need arises) is a binary breaking change.


Yes your feeling is good. It's not right to have such methods inside Model. 1a. Models should only contain properties (in my opinion). 1b. Data-related methods like your SQL fetching should be encapsulate within Repositories. Repository pattern helps abstracting out the database connections we are using. Says you have dozens of models like this, and one ...


WCF uses SOAP, which has a lot of overhead to use. In this case, you would probably need to auto generate clients for particular platforms, because it would be too much work by hand. There are a lot of features in WCF, but it has generally fallen out of favor due to the communication overhead and code required compared to simpler models like ordinary HTTP ...


It's tempting to ruthlessly eliminate duplication in our systems, and for very good reasons, but we must always ask ourselves whether this is real duplication or apparent duplication. What I mean is that we'll sometimes have code that looks identical, but each will have their own reason to change, independent of each other. If you think the view model for ...


Check all classes you stored in session are "[Serializable]" [Serializable] public class SampleClass { }

Top 50 recent answers are included