public bool SaveCategories(Category category) { var context = new APPContext(); context.Categories.Add(category); return(context.SaveChanges() > 0); }
public bool DeleteCategories(Category category) { var context = new APPContext(); context.Entry(category).State = System.Data.Entity.EntityState.Deleted; return(context.SaveChanges() > 0); }
public int SearchCategoriesCount(string searchTerm) { var context = new APPContext(); var category = context.Categories.AsQueryable(); if (!string.IsNullOrEmpty(searchTerm)) { category = category.Where(a => a.Name.ToLower().Contains(searchTerm.ToLower())); } return(category.Count()); }
public List <Category> SearchCategories(string searchTerm, int pageNo, int recordSize) { var context = new APPContext(); var categories = context.Categories.AsQueryable(); if (!string.IsNullOrEmpty(searchTerm)) { categories = categories.Where(a => a.Name.ToLower().Contains(searchTerm.ToLower())); } var skipCount = (pageNo - 1) * recordSize; return(categories.OrderBy(x => x.Name).Skip(skipCount).Take(recordSize).ToList()); //return accomodationTypes.ToList(); }
public Category GetCategoriesById(int ID) { var context = new APPContext(); return(context.Categories.Find(ID)); }
public List <Category> GetAllCategories() { var context = new APPContext(); return(context.Categories.ToList()); }
public RepositoryCommand(APPContext context) { this._context = context; }
public ApplicationUserStore(APPContext context) : base(context) { }
public RepositoryCommand() { this._context = new APPContext(); }
public FileUploadController(APPContext context) { this.context = context; }
public RepositoryQuery() { this._context = new APPContext(); }
public RepositoryQuery(APPContext context) { this._context = context; }
public ItemsController(APPContext context) { _context = context; }
public List <LanguageResource> GetLanguageResources() { var context = new APPContext(); return(context.LanguageResources.ToList()); }
public Language GetLanguageByShortCode(string shortCode) { var context = new APPContext(); return(context.Languages.FirstOrDefault(x => x.ShortCode == shortCode)); }
public Language GetDefaultLanguage() { var context = new APPContext(); return(context.Languages.FirstOrDefault(x => x.IsDefault)); }
public ApplicationRoleStore(APPContext context) : base(context) { }
public UserService(APPContext aPPContext) { _appContext = aPPContext; }