SHARE
TWEET

Untitled

a guest Jun 16th, 2019 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void AddChampion(Campeon campeon);
  2.  
  3.      void AddUser(Usuario user);
  4.  
  5.      List<Usuario> ListUsers();
  6.  
  7.      List<Rol> ListRoles();
  8.  
  9.  
  10.  
  11. }
  12.  
  13. public class NarachiService : INarachiService
  14. {
  15.     private readonly NarachiContext context;
  16.  
  17.     public NarachiService(NarachiContext context)
  18.     {
  19.         this.context = context;
  20.     }
  21.  
  22.     public List<Campeon> ListChampions()
  23.     {
  24.         return context.Campeon.ToList();
  25.     }
  26.  
  27.     public void AddChampion(Campeon campeon)
  28.     {
  29.         context.Campeon.Add(campeon);
  30.         context.SaveChanges();
  31.  
  32.     }
  33.  
  34.     public void AddUser(Usuario user)
  35.     {
  36.         context.Usuario.Add(user);
  37.         context.SaveChanges();
  38.     }
  39.  
  40.     public List<Usuario> ListUsers()
  41.     {
  42.         return context.Usuario.ToList();
  43.     }
  44.  
  45.     public List<Rol> ListRoles()
  46.     {
  47.         var Roles = context.Rol.ToList();
  48.  
  49.         return Roles;
  50.     }
  51.  
  52. }
  53.      
  54. public frmNarachi(NarachiService mainService)
  55.     {
  56.         InitializeComponent();
  57.         MainService = mainService;
  58.     }
  59.  
  60.     public frmNarachi()
  61.     {
  62.         InitializeComponent();
  63.     }
  64.  
  65.     private void frmNarachi_Load(object sender, EventArgs e)
  66.     {
  67.  
  68.  
  69.  
  70.     }
  71. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top