Quantcast
Channel: Security
Viewing all articles
Browse latest Browse all 4737

Accessing added fields from DataFirst db in entityframework context

$
0
0

I am working with a DatabaseFirst EFv6 webapp in webforms and want to create a dropdown list of all users. My external db has a table AspNetUsers from which the EF is deriving its users.

The AspNetUsers table has added columns eg Firstname, Lastname, and I have Updated my EF,  and now in the EF model edmx diagram I see the new fields.

However if I try to create a list of users with which to populate my dropdown I can see all the original columns in the db table but not the new ones generated before the Update.

This is the code with which I generate the list to bind to the control. 

Imports System.Web.ModelBinding
Imports Microsoft.AspNet.Identity

...

Dim context = New IdentityDbContext 
Dim allUsers = context.Users.ToList()

I can of course populate the dd via an sqldatasource but I really want to understand Identity and be able to do it more elegantly. 

Any help appreciated.


Viewing all articles
Browse latest Browse all 4737

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>