public UserWithRolesController(SeboDbContext context, UserManager <IdentityUser> userManager , SignInManager <IdentityUser> signInManager , RoleManager <IdentityRole> roleManager) { _context = context; _userManager = userManager; _signInManager = signInManager; _roleManager = roleManager; }
public static IQueryable <Course> CourseName(SeboDbContext _context, params string[] keywords) { IQueryable <Course> query = from q in _context.Course select q; foreach (string keyword in keywords) { string temp = keyword; query = query.Where(p => p.CourseName.Contains(temp)); } return(query); }
public static IQueryable <Course> SearchCourseName(SeboDbContext _context, params string[] keywords) { var predicate = PredicateBuilder.False <Course>(); foreach (string keyword in keywords) { string temp = keyword; predicate = predicate.Or(p => p.CourseName.Contains(temp)); } return((from s in _context.Course select s).Where(predicate)); }
public static void Initialize(SeboDbContext context) { // context.Database.EnsureCreated(); // //Ckecking whether exist records in the table // if (context.Category.Any()) // { // return; // } // //* // // If there is no record the table is initialized // // // var Categories = new Category[] // { // new Category{ CategoryName ="Action"}, // new Category{ CategoryName ="Adult"}, // new Category{ CategoryName ="Adventure"}, // new Category{ CategoryName ="Animation"}, // new Category{ CategoryName ="Anime"}, // new Category{ CategoryName ="Biography"}, // new Category{ CategoryName ="Cartoon"}, // new Category{ CategoryName ="Comedy"}, // new Category{ CategoryName ="Comedy Drama"}, // new Category{ CategoryName ="Comedy-Romance"}, // new Category{ CategoryName ="Crime"}, // new Category{ CategoryName ="Documentary"}, // new Category{ CategoryName ="Drama"}, // new Category{ CategoryName ="Fantasy"}, // new Category{ CategoryName ="Horror"}, // new Category{ CategoryName ="Martial-Arts"}, // new Category{ CategoryName ="Musical"}, // new Category{ CategoryName ="Mystery"}, // new Category{ CategoryName ="Reality-TV"}, // new Category{ CategoryName ="Romance"}, // new Category{ CategoryName ="Scifi"}, // new Category{ CategoryName ="Sport"}, // new Category{ CategoryName ="Superhero"}, // new Category{ CategoryName ="Talk Show"}, // new Category{ CategoryName ="Thriller"}, // new Category{ CategoryName ="TV Series"}, // new Category{ CategoryName ="TV Shows"}, // new Category{ CategoryName ="War"}, // new Category{ CategoryName ="Western"} // }; // foreach (Category c in Categories) // { // context.Category.Add(c); // } // context.SaveChanges(); }
public static int GetUserId(string UserName, SeboDbContext _context) { var user = (from s in _context.User where s.UserName == UserName select s.UserId).ToList(); if (user.Count() > 0) { return(user[0]); } else { return(-1); } }
public static IQueryable <Book> SearchBook(SeboDbContext _context, string sortOrder = "title_asc", params string[] keywords) { IQueryable <Book> books = (from b in _context.Book select b); if (keywords.Length > 0) { var predicate = PredicateBuilder.False <Book>(); foreach (string keyword in keywords) { string temp = keyword; predicate = predicate.Or(p => p.Title.Contains(temp)).Or(p => p.Description.Contains(temp)).Or(p => p.ISBN.Contains(temp)); } books = (from b in _context.Book select b).Where(predicate); } books = OrderingBooks.Do(books, sortOrder); return(books); }
public BookConditionsController(SeboDbContext context) { _context = context; }
public InstitutionsController(SeboDbContext context) { _context = context; }
public LocalizationsController(SeboDbContext context) { _context = context; }
public BooksController(SeboDbContext context) { _context = context; }
public OrdersController(SeboDbContext context) { _context = context; }
public CustomerServicesController(SeboDbContext context) { _context = context; }
public AlertsController(SeboDbContext context) { _context = context; }
public CoursesController(SeboDbContext context) { _context = context; }
public HomeController(SeboDbContext context) { _context = context; }
public ClaimsController(SeboDbContext context) { _context = context; }
public StudyAreasController(SeboDbContext context) { _context = context; }
public static IQueryable <Book> SearchBooks(SeboDbContext _context, params string[] keywords) { string sortOrder = "title_asc"; return(SearchBook(_context, sortOrder, keywords)); }
public ClaimMediationsController(SeboDbContext context) { _context = context; }