in Education by
I have a Member class: public class Member { // key public Guid UserId { get; set; } // some other fields } Also I have a aspnet_Users table with has UserId primary column. We can: 1). Add additional property MembershipUser to the Member object and get it's value by calling Membership.GetUser(this.UserId) method. Also I've add context.Database.ExecuteSqlCommand("ALTER TABLE [dbo].[Members] WITH CHECK ADD CONSTRAINT [FK_Members_aspnet_Users] FOREIGN KEY([UserId]) REFERENCES [dbo].[aspnet_Users] ([UserId])"); to the DataContext.Seed() method to ensure that Member can not be added without aspnet_Users account. 2). Use fluent API in OnModelCreating. If this a good case how to map them correctly? What's the best choice? Any thoughts? JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
No matter how I tried to avoid it, I've found the best approach is to implement my own MembershipProvider and have it use my model, rather than trying to shoehorn my model into the built-in membership provider. If you are going down the other route you have to map the ASP.NET Membership tables to your domain and derive your Member class from the ASP_User class (or vice versa if you want to ensure that all Users you create are Members). In the end, I've discovered that although it seems like more effort up front, implementing MembershipProvider is the easier approach.

Related questions

0 votes
    How to get the UserID of all the currently logged in users using Apex code?...
asked Nov 11, 2020 in Technology by JackTerrance
0 votes
    What will be the output of the following Python code? >>>list1 = [1, 3] >>>list2 = list1 >>>list1[0] = 4 >>>print(list2) a) [1, 4] b) [1, 3, 4] c) [4, 3] d) [1, 3]...
asked Jan 2, 2023 in Technology by JackTerrance
0 votes
    What will be the output of the following Python code snippet? for i in [1, 2, 3, 4][::-1]: print (i) a) 4 3 2 1 b) error c) 1 2 3 4 d) none of the mentioned...
asked Jan 2, 2023 in Technology by JackTerrance
0 votes
    An unhandled exception of type System.AggregateException occurred in mscorlib.dll Inner Exception: {"Response status ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 14, 2022 in Education by JackTerrance
0 votes
    I am using EF for access MS SQL data with help LINQ. How can I get current isolation level ? For ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 2, 2022 in Education by JackTerrance
0 votes
    On many sites/blogs I noticed that people, who want to explain linq mechanism, write Linq Queries and ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jan 15, 2022 in Education by JackTerrance
0 votes
    The rate constant for the first order decompoistion of a certain reaction is described by the equation logk(s-1)= ... periof be 256min? Select the correct answer from above options...
asked Jan 4, 2022 in Education by JackTerrance
0 votes
    The (first) page of the website that opens is called? options 1 (Homepage) 2(webpage) 3(main page)4( non of the above) Select the correct answer from above options...
asked Dec 13, 2021 in Education by JackTerrance
0 votes
    Consider a function Z(s)=5(s+1)(s+4)/(s+3)(s+5). Find the value of R1 after performing the ... theory Questions for GATE EC Exam, Network Theory MCQ (Multiple Choice Questions)...
asked Oct 12, 2021 in Education by JackTerrance
0 votes
    Consider a function Z(s)=5(s+1)(s+4)/(s+3)(s+5). Find the value of L1 after performing the ... theory Questions for GATE EC Exam, Network Theory MCQ (Multiple Choice Questions)...
asked Oct 12, 2021 in Education by JackTerrance
0 votes
    Consider a function Z(s)=5(s+1)(s+4)/(s+3)(s+5). Find the value of R2 after performing the ... theory Questions for GATE EC Exam, Network Theory MCQ (Multiple Choice Questions)...
asked Oct 12, 2021 in Education by JackTerrance
0 votes
    Consider a function Z(s)=5(s+1)(s+4)/(s+3)(s+5). Find the value of L2 after performing the ... theory Questions for GATE EC Exam, Network Theory MCQ (Multiple Choice Questions)...
asked Oct 12, 2021 in Education by JackTerrance
0 votes
    Consider the impedance function Z(s)=3(s+2)(s+4)/(s+1)(s+3). Find the value of R1 after realizing ... Questions for GATE EC Exam, Network Theory MCQ (Multiple Choice Questions)...
asked Oct 12, 2021 in Education by JackTerrance
0 votes
    Consider the impedance function Z(s)=3(s+2)(s+4)/(s+1)(s+3). Find the value of C1 after realizing ... Questions for GATE EC Exam, Network Theory MCQ (Multiple Choice Questions)...
asked Oct 12, 2021 in Education by JackTerrance
...