asp.net mvc - Workflow with MVC 4 - EF 5 - SimpleMembershipProvider -
so want build application mvc 4 , entity framework 5. i've build simple applications before, need security around current effort... have confusion / questions hoping answer;
first... using mvc 4 internet application template implements simplemembershipprovider. have read every primary article modification, implementation... however, uses code-first implementation... problem: have existing database import scheme edmx database first approach... how implement mvc 4 simple membership provider when database ties tightly , directly user table (userid)?... know can use own user table long designate userid , username fields documented... affect provider, or existing "accountcontroller" code? these need modified?
second, looking workflow architecture... "old school" database first approach... project huge wip (work in progress). have foundation, need expand needed... can provide insight database first vs other approaches when there quite bit of change management occurring?
you can still use code first map existing database. may need explicitly map properties table columns because mappings not follow default conventions, doesn't prevent using code first.
when transitioning db first mindset. focus on how objects interact each other. then, @ point save state of objects after interacted. orm comes play. detects changes , executes necessary sql statements persist current state of objects.
think of database storage container. in theory replaced persistent storage mechanism (document db, file, persistent hash table, in memory list, etc.). in reality it's not simple, idea of treating db simple storage container helps break away monolithic database concept is/was ingrained devs.
but don't loose perspective of design either. if it's simple forms-over-data app adding features in future keep design simple. don't try totally abstract db away. know it's there , relationship ui 1:1, take advantage of that.
in it's simplest form separation of concerns can achieved using mvc controller manage interaction between model (mapped db via orm) , view (razor templates) personal preference keep orm out of views typically query database, map domain model viewmodel , pass viewmodel view.
again if it's simple application , screens map directly database viewmodel overkill.
Comments
Post a Comment