예제 #1
0
 public List <UserProductLinkTables> GetProductsByUserId(int userId)
 {
     using (var dbContext = new SecDbContext())
     {
         return(dbContext.UserProductLink.Where(d => d.UserId == userId).ToList());
     }
 }
예제 #2
0
 public UserProfile GetUserProfile(string username)
 {
     using (var dbContext = new SecDbContext())
     {
         return(dbContext.UserProfiles.SingleOrDefault(f => f.UserName.ToUpper() == username.ToUpper()));
     }
 }
예제 #3
0
 public void AddToWardrobe(string productName, int userId)
 {
     using (var dbContext = new SecDbContext())
     {
         dbContext.UserProductLink.Add(new UserProductLinkTables {
             ProductName = productName, UserId = userId
         });
         dbContext.SaveChanges();
     }
 }