Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > ASP.NET 4 General Discussion
|
ASP.NET 4 General Discussion For ASP.NET 4 discussions not relating to a specific Wrox book
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 4 General Discussion section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 17th, 2013, 01:34 PM
Friend of Wrox
 
Join Date: Oct 2009
Posts: 341
Thanks: 14
Thanked 3 Times in 3 Posts
Default integrate aspnet membership objects with EF

Hello all,
I am using EF in my project. I want to integrate aspnet membership tables, SPs, Views with EF.
I am using database first approach. It means I am creating DB first and then drag and drop tables into EF diagram.
1. Please tell me how I can integrate membership objects with EF.
2. After integrating will all methods and properties be available directly as we have in case of separate db or we need to do something else to get access.
3. Will there be any requirement of defining connection string in web.config for membership, profile and role providers.
Please help me.
Thanks
 
Old July 19th, 2013, 07:52 AM
Authorized User
 
Join Date: Jun 2013
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I guess i have the same query..do help anyone on this thing..
__________________
REI Coupon
 
Old July 30th, 2013, 02:11 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there.

I would recommend against this. The Membership API has its own business rules that you'll bypass when mapping to EF.

Why do you want to do this?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old August 8th, 2013, 12:15 PM
Friend of Wrox
 
Join Date: Oct 2009
Posts: 341
Thanks: 14
Thanked 3 Times in 3 Posts
Smile

Hi Imar,

Quote:
Why do you want to do this?
Keeping membership details separately needs connection string in web.config.
Which will expose the DB details to some other development team.

Basically I do not want to expose any DB connection to any one, although web.config will not be accessed to normal users but can be seen by development team over FTP.

So, please tell me is there any way to hide DB connection string from development teams or mapping membership objects to EF, without loosing facilities membership API provides?

Thanks
 
Old August 8th, 2013, 04:19 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

I don't understand the problem or the description (you need a connection string for EF anyway) but if you have the need, you can encrypt the contents of the web.config file.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old August 9th, 2013, 02:00 PM
Friend of Wrox
 
Join Date: Oct 2009
Posts: 341
Thanks: 14
Thanked 3 Times in 3 Posts
Default

I have checked few articles about encrypting web.config file. But I saw that encrypted file can be decrypted easily with reverse process.

So if development team gets encrypted file then will not they be able to decrypt the file?
 
Old August 10th, 2013, 02:11 AM
Staceysmith
Guest
 
Posts: n/a
Default

thanks to both for the support ..
Received Warning
 
Old August 10th, 2013, 08:39 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Depending on how they have access to the server: yes.

But I don't see the point of this. What are you trying to protect and why in this way? It looks like you're choosing the wrong tool for the job. Typically, your development connection string should be different from your production environment and then you could / should block developers from accessing the production server.

You could hide the connection string but if they own the code, how hard is it to read it programmatically, or to access the database for whatever activity you're trying to block them from.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old August 15th, 2013, 01:09 PM
Friend of Wrox
 
Join Date: Oct 2009
Posts: 341
Thanks: 14
Thanked 3 Times in 3 Posts
Default

Hi Imar,

That's why I want that if it is possible to integrate membership objects with EF so that it connection string be built with EF and may be put in DLL.

Thanks
 
Old August 15th, 2013, 01:37 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Quote:
That's why I want that if it is possible to integrate membership objects with EF so that it connection string be built with EF and may be put in DLL.
But I fail to see what the point is. What do you accomplish with this?

Membership has its own logic in stored procedures and code (for example, parsing a password). For that, you'll need to use the Membership classes which in turn need a connection string. Simply mapping the Membership data model in your own EF model is not enough.

Can you elaborate on *why* you try to do all this? From a security, maintenance, and development point of view, none of this makes a lot of sense to me so far.

Cheers.

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!





Similar Threads
Thread Thread Starter Forum Replies Last Post
connectionString using EF nanonerd ASP.NET 4 General Discussion 6 July 19th, 2012 01:28 PM
Generic Question and EF vbboyd BOOK: Beginning ASP.NET 4 : in C# and VB 4 May 19th, 2011 04:14 PM
ASPNET account for ASPNET.MDF DB-Please help rsearing ASP.NET 2.0 Basics 13 November 6th, 2007 11:54 PM
upload aspnet membership schema Maxxim BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 23 October 11th, 2007 03:20 AM
Convert ASPNET 1.1 Project To ASPNET 2.0 [email protected] ASP.NET 2.0 Basics 3 June 29th, 2006 02:59 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.