![]() ![]() You are tying UI concerns in your business models. Since it's a resource in my views folder intended for views? I'm using localized strings from my views/resources.resx in my Modelįor Display Attributes, does this violate the separation of concerns The Model public class RestaurantReviewModel The attributes that I commented out in the next class are the attributes I think i need to remove for the Model. The ViewModel public class RestaurantReviewViewModel Also, so the ViewModel tells the browser to tell the user when he's putting an invalid value in. The reason I think that I need Validation Annotations on both classes is so that the Model class can tell EF to put the correct constraints into database when I change schema with DbMigrations. But, If this is true, then I have two classes to maintain Validation Annotations if I decide to add another property!? In my Model I think I need to keep just the Validation Annotations. I think I need to keep all the Display Annotations and Validation Annotations (like and ) that I have in my ViewModel. Do I need a ViewModel for my Model to keep separation of concerns? And if so, which Annotations need to go on my model's properties, and which need to go on the ViewModel properties?.I'm using localized strings from my views/resources.resx in my Model for Display Attributes, does this violate the separation of concerns since it's a resource in my views folder intended for views?.In both, I am wondering if I am violating the separation of concerns: I have two questions but both are kind of related to each other. But additional separation of concerns questions arose as I began implementing. And my interpretation of their answer was "No, not if you're using a ViewModel for Display Annotations". I read this question and answers, about if Display Annotations on model properties violates the separation of concerns between view and model. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |