EF code-first how to use POCO objects in client layers
I'm new asp.net MVC and EF, so excuse me if my question is not clear or
easy question
I have read some tutorials about EF Code-First approach and now I'm trying
this tutorial Getting Started with EF using MVC
Using Code-First approach I'm using the POCO classes to define my DB
model, DB logic, DB validation ,UI validation and some UI logic. So I can
use these classes(or objects) in my presentation layer or using them as
JSON objects when dealing with Web-Services(or in JavaScript code).
My question Isn't that mix some logic together? I mean shouldn't I use
like speacial view-model classes for presentation and these classes should
have the UI logic and validation ?!
Is it good practice to send the POCO object to the view(or to the client
in general) ?
Finally i need some guidance on how to organize my project layers or
folders? I see many ways and I'm confused about what to choose or what
based on I should choose?!!
No comments:
Post a Comment