40898

MVC4 Simple Membership with custom database and database first issue

Question:

I am implementing Membership and security in my MVC4 website using custom database. Every things working fine but when I used .EDMX(Designer) to add my database tables membership and security starts giving errors. <strong>I also know the reason: This is due to duplicate Class files as default membership use code first approach and I am using database first approach.</strong> My question is there is any soluton that I can work using database first(EDMX) and also my security and membership functionality works fine.

Thanks.

Answer1:

The following post details the steps to take when using SimpleMembership with a Database-First approach: <a href="https://stackoverflow.com/questions/15112214/using-mvc-4-simplemembership-with-an-existing-database-first-ef-model/15234074#15234074" rel="nofollow">Using MVC 4 SimpleMembership with an existing database-first EF model</a>

Also, you may find the following link has some useful information about SimpleMembership: <a href="http://weblogs.asp.net/jgalloway/archive/2012/08/29/simplemembership-membership-providers-universal-providers-and-the-new-asp-net-4-5-web-forms-and-asp-net-mvc-4-templates.aspx" rel="nofollow">http://weblogs.asp.net/jgalloway/archive/2012/08/29/simplemembership-membership-providers-universal-providers-and-the-new-asp-net-4-5-web-forms-and-asp-net-mvc-4-templates.aspx</a>

Recommend

  • Merge list of objects into consistent list based on common matching attribute in Python
  • Insert records if not exist SQL Server 2005
  • R sqldf renaming a field in a select statement
  • Unique Permutations - with exceptions
  • Available space left on drive - WinAPI - Windows CE
  • C# - Most efficient way to iterate through multiple arrays/list
  • Consuming a WCF service in a Java Client using wsHttpBinding
  • Cloud Code function running twice
  • Trying to get the char code of ENTER key
  • SAXReader not re-ecape characters
  • Using Sax parsing to edit and write XML in VB6
  • How to revert to previous XCode version?
  • How can I set a binding to a Combox in a UserControl?
  • why xml file does not aligned properly after append the string in beginning and end of the file usin
  • Debug.DrawLine not showing in the GameView
  • Make VS2015 use angular-cli ng at build time in a .NET project
  • Yii2: Config params vs. const/define
  • Python CGI os.system causing malformed header
  • Ajax Loaded meta Tags
  • R - Combining Columns to String Based on Logical Match
  • Get one-time binding to work for ng-if
  • Xamarin Forms - UWP Fonts
  • Running a C# exe file
  • Where to put my custom functions in Wordpress?
  • Arrow is showed instead of the material design version hamburger icon. Why doesn't syncState in
  • Do create extension work in single-user mode in postgres?
  • Jquery - Jquery Wysiwyg return html as a string
  • R: gsub and capture
  • Numpy divide by zero. Why?
  • Confusion with PayPal's monthly billing cycle
  • jqPlot EnhancedLegendRenderer plugin does not toggle series for Pie charts
  • Arrays break string types in Julia
  • SetUp method failed while running tests from teamcity
  • Comma separated Values
  • What are the advantages and disadvantages of reading an entire file into a single String as opposed
  • Java static initializers and reflection
  • unknown Exception android
  • Observable and ngFor in Angular 2
  • Unable to use reactive element in my shiny app
  • How to load view controller without button in storyboard?