Why does Microsoft combine the logic methods with Model classes together?http://forums.asp.net/t/1754841.aspx/1?Why+does+Microsoft+combine+the+logic+methods+with+Model+classes+together+Tue, 10 Jan 2012 02:12:14 -050017548414759265http://forums.asp.net/p/1754841/4759265.aspx/1?Why+does+Microsoft+combine+the+logic+methods+with+Model+classes+together+Why does Microsoft combine the logic methods with Model classes together? <p>I found that whether the Strong-typed TableAdapteror LINQ or EFMicrosoft is always fixing the CRUD methods with model classes togetherWhy don't create layer cs files so as to seperate CRUD methods from model classes together in different namespacesThat'd be OK and easy for Microsoft</p> <p>PSThis isn't a question about real EF or LINQ or a ADO.NETWhat I'm intersted in is Why they are designed like thisSO THIS IS A DESIGNING QUESTIOPLEASE DON'T MOVE THE THREAD TO ADO.NET, LINQ OR EF PART</p> 2012-01-02T02:57:47-05:004759583http://forums.asp.net/p/1754841/4759583.aspx/1?Re+Why+does+Microsoft+combine+the+logic+methods+with+Model+classes+together+Re: Why does Microsoft combine the logic methods with Model classes together? <p></p> <blockquote><span class="icon-blockquote"></span> <h4>TimoYang</h4> Microsoft is always fixing the CRUD methods with model classes together</blockquote> <p></p> <p>Are you talking about tutorials? Or what?</p> <p></p> <blockquote><span class="icon-blockquote"></span> <h4>TimoYang</h4> Why don't create layer cs files so as to seperate CRUD methods from model classes together in different namespaces</blockquote> <p></p> <p>There's nothing to stop you doing this yourself if that's how you like to organise your app.</p> 2012-01-02T07:20:48-05:004759643http://forums.asp.net/p/1754841/4759643.aspx/1?Re+Why+does+Microsoft+combine+the+logic+methods+with+Model+classes+together+Re: Why does Microsoft combine the logic methods with Model classes together? <p></p> <blockquote><span class="icon-blockquote"></span> <h4>Mikesdotnetting</h4> Are you talking about tutorials? Or what?</blockquote> <p></p> <p>Hello again,</p> <p>I mean when you use LINQ, EF or TableAdapter... When you see the auto-generated codes, you will find that model classes are always mixed with CRUD mtthods. If you are using EF, you can see codes like this:</p> <p>using (XXXEntityContext efc = new&nbsp;XXXEntityContext())<br> {<br> &nbsp; &nbsp; efc.XXXs.AddXXX(instancehere....);<br> }&nbsp;</p> <p>Don't you see Insert, delete, as well as update things come from XXXEntitContext, but the model class comes from this same Namespace,too...</p> <p>I think it's better to seperate them from each other.</p> 2012-01-02T08:06:27-05:004773127http://forums.asp.net/p/1754841/4773127.aspx/1?Re+Why+does+Microsoft+combine+the+logic+methods+with+Model+classes+together+Re: Why does Microsoft combine the logic methods with Model classes together? <p></p> <blockquote><span class="icon-blockquote"></span> <h4>TimoYang</h4> Why don't create layer cs files so as to seperate CRUD methods from model classes together in different namespaces</blockquote> <p></p> <p>Yep I understand your question and I am not sure exactly why the auto-generated classes are not separated as you ask. Logically if we were building our own application we would probably do this and separate the methods possible into even different layers. However the beauty of a technology like EF is not having to concern ourselves too deeply with what is happening under the covers so long as it works (and move on to coding what is most important: typically the domain or business logic). I think the best folks that could provide&nbsp;insight into <em>why </em>the EF classes are designed the way they are is someone on the EF or ADO.NET team at MSFT. You can take a look at their blog below and possibly get the answer direct from those that helped design it.</p> <p><strong>ADO.NET team blog:</strong><br> <a href="http://blogs.msdn.com/b/adonet/">http://blogs.msdn.com/b/adonet/</a></p> 2012-01-09T13:55:12-05:004773960http://forums.asp.net/p/1754841/4773960.aspx/1?Re+Why+does+Microsoft+combine+the+logic+methods+with+Model+classes+together+Re: Why does Microsoft combine the logic methods with Model classes together? <p>Hello atconway,</p> <p>So you mean that it's a GENERAL IDEA AND DESIGN? And we can still add up something to it when we need... And MS wants to make us &quot;most flexible&quot;???</p> 2012-01-10T02:12:14-05:00