Click here to Skip to main content
15,891,033 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionTexbox OnKeyPress event thru javascript executes a button click event Pin
bjay tiamsic8-Jul-14 15:23
bjay tiamsic8-Jul-14 15:23 
QuestionGridView Structure Clone Pin
sakalans8-Jul-14 5:35
sakalans8-Jul-14 5:35 
AnswerRe: GridView Structure Clone Pin
thatraja9-Jul-14 0:44
professionalthatraja9-Jul-14 0:44 
QuestionASP MVC 5 application users Pin
AnCristina8-Jul-14 2:05
professionalAnCristina8-Jul-14 2:05 
AnswerRe: ASP MVC 5 application users Pin
Vi(ky8-Jul-14 2:27
Vi(ky8-Jul-14 2:27 
GeneralRe: ASP MVC 5 application users Pin
AnCristina8-Jul-14 6:51
professionalAnCristina8-Jul-14 6:51 
GeneralRe: ASP MVC 5 application users Pin
Vi(ky8-Jul-14 22:46
Vi(ky8-Jul-14 22:46 
GeneralRe: ASP MVC 5 application users Pin
AnCristina9-Jul-14 0:04
professionalAnCristina9-Jul-14 0:04 
Ok , I got stuck again .
So I created the classes :
Role :
C#
public class Role
{
    public Role() { }
    public Role(string name, int id):this()
    {
        this.RoleId = id;
        this.Name = name;
    }
    [Key]
    [Required]
    public virtual int RoleId { get; set; }
    public virtual string Name { get; set; }
}


Permission :
C#
    public Permission()
    { }
    public Permission(string name,int id):this()
    {
        this.Name=name;
        this.Id = id;
    }
    [Key]
    [Required]
    public virtual int Id { get; set; }
    public virtual string Name { get; set; }
}

RolePermission :
C#
public class RolePermission
{
    public Role Role { get; set; }
    public Permission Group { get; set; }
    [Required]
    public int RoleGroupId { get; set; }
    public RolePermission() { }

}

I updated the ApplicationUser class
C#
public class ApplicationUser : IdentityUser
{
    public ApplicationUser()
        : base()
    {
        this.Permission=new HashSet<RolePermission>();
    }
    [Required]
    public string Name { get; set; }
    public virtual ICollection<RolePermission> Permission { get; set; }
}

Is this correct up to this point ?
I suppose I should modify the ApplicationDbContext , which , up to this point , looks like this :
C#
public class ApplicationDbContext : IdentityDbContext<ApplicationUser>
{
    public ApplicationDbContext()
        : base("DefaultConnection")
    {

    }
}

What changes should I do ?
GeneralRe: ASP MVC 5 application users Pin
Vi(ky10-Jul-14 2:18
Vi(ky10-Jul-14 2:18 
GeneralRe: ASP MVC 5 application users Pin
AnCristina11-Jul-14 20:57
professionalAnCristina11-Jul-14 20:57 
Questionbally chohan and baljinder chohan integration with same domain using php? Pin
gauravkumar027-Jul-14 23:14
gauravkumar027-Jul-14 23:14 
AnswerRe: bally chohan and baljinder chohan integration with same domain using php? Pin
Richard MacCutchan8-Jul-14 1:29
mveRichard MacCutchan8-Jul-14 1:29 
QuestionRe: bally chohan and baljinder chohan integration with same domain using php? Pin
Richard Deeming8-Jul-14 1:56
mveRichard Deeming8-Jul-14 1:56 
AnswerRe: bally chohan and baljinder chohan integration with same domain using php? Pin
Richard MacCutchan8-Jul-14 2:50
mveRichard MacCutchan8-Jul-14 2:50 
AnswerRe: bally chohan and baljinder chohan integration with same domain using php? Pin
Bernhard Hiller8-Jul-14 22:59
Bernhard Hiller8-Jul-14 22:59 
QuestionMovie not loaded message when pointing embed src to "d:\abc\story.swf" Pin
SURESH_KATARI7-Jul-14 20:36
SURESH_KATARI7-Jul-14 20:36 
AnswerRe: Movie not loaded message when pointing embed src to "d:\abc\story.swf" Pin
thatraja7-Jul-14 21:08
professionalthatraja7-Jul-14 21:08 
GeneralRe: Movie not loaded message when pointing embed src to "d:\abc\story.swf" Pin
SURESH_KATARI7-Jul-14 21:19
SURESH_KATARI7-Jul-14 21:19 
AnswerRe: Movie not loaded message when pointing embed src to "d:\abc\story.swf" Pin
thatraja7-Jul-14 22:26
professionalthatraja7-Jul-14 22:26 
GeneralRe: Movie not loaded message when pointing embed src to "d:\abc\story.swf" Pin
SURESH_KATARI8-Jul-14 0:07
SURESH_KATARI8-Jul-14 0:07 
QuestionWeb API versions Pin
Mycroft Holmes7-Jul-14 16:31
professionalMycroft Holmes7-Jul-14 16:31 
AnswerRe: Web API versions Pin
Kornfeld Eliyahu Peter7-Jul-14 20:29
professionalKornfeld Eliyahu Peter7-Jul-14 20:29 
GeneralRe: Web API versions Pin
Mycroft Holmes7-Jul-14 22:05
professionalMycroft Holmes7-Jul-14 22:05 
AnswerRe: Web API versions Pin
Kornfeld Eliyahu Peter7-Jul-14 22:15
professionalKornfeld Eliyahu Peter7-Jul-14 22:15 
Questioncontrols in Gridview footer generating different ids in Windows 2003 server vs Windows 2008 server Pin
Huskies777-Jul-14 7:29
Huskies777-Jul-14 7:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.