Пример #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();
     }
 }