Ejemplo n.º 1
0
 public static void InitializeDatabase()
 {
     using (WosContext context = new WosContext(null))
     {
         context.Database.Initialize(false);
     }
 }
Ejemplo n.º 2
0
 // GET: /api/users
 public List <UserViewModel> Get()
 {
     using (WosContext ctx = new WosContext(User.Identity.GetUserId()))
     {
         return(ctx.Users.Select(u => new UserViewModel
         {
             Email = u.Email,
             Blames = u.Blames.Select(b => new BlameViewModel
             {
                 ID = b.ID,
                 ShameID = b.ShameID,
                 UserID = b.UserID,
                 CreatedAt = b.CreatedAt,
                 CreatedBy = b.CreatedBy
             }).ToList()
         }).ToList());
     }
 }
Ejemplo n.º 3
0
 public BlameRepository(string userID)
 {
     _context = new WosContext(userID);
 }