Last active
January 31, 2018 10:45
-
-
Save gsedubun/f08a80c4728f8c38356d92811a390a03 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.ComponentModel.DataAnnotations; | |
using Microsoft.EntityFrameworkCore; | |
namespace belajarnetcoremvc.Models | |
{ | |
public class belajarDbContext :DbContext | |
{ | |
public belajarDbContext(DbContextOptions options) : base(options) | |
{ | |
} | |
public DbSet<TblRole> TblRole { get; set; } | |
public DbSet<TblUser> TblUser { get; set; } | |
public DbSet<TblUserRole> TblUserRole { get; set; } | |
} | |
public class TblUser | |
{ | |
[Key] | |
public int UserID { get; set; } | |
public string UserName { get; set; } | |
public string Password { get; set; } | |
public string EmailAddress { get; set; } | |
} | |
public class TblRole{ | |
[Key] | |
public int RoleID { get; set; } | |
public string RoleName { get; set; } | |
} | |
public class TblUserRole | |
{ | |
[Key] | |
public int ID { get; set; } | |
public TblUser TblUser { get; set; } | |
public TblRole TblRole { get; set; } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment