public Task Handle(AddNewCategoryCommand request, CancellationToken cancellationToken) { var category = new Category(); category.Name = request.Name; category.Description = request.Description; #region Add CategoryFields var categoryFields = new List <CategoryField>(); for (var i = 0; i < request.CategoryFieldNames.Count; i++) { var categoryFieldType = _categoryFieldTypeRepository.GetByCode(request.CategoryFieldTypes[i]); var categoryField = new CategoryField { Name = request.CategoryFieldNames[i], CategoryFieldType = categoryFieldType, Description = "test" }; categoryFields.Add(categoryField); } category.CategoryFields = categoryFields; #endregion _categoryRepository.Add(category); Commit(); return(Task.CompletedTask); }
public virtual void RemoveCategory(CategoryField category) { if (Categories.Contains(category)) { Categories.Remove(category); } }
public void FirstSteps() { StringAssert.Contains(driver.Title, "CEL"); Assert.AreEqual(true, logoField.Displayed); // SelectCategory(8); //ClickSubcategory(); //Thread.Sleep(5000); //antivirusField.Click(); // HoverAndClick(driver,CategoryField, boxField,antivirusField); CategoryField.Click(); boxField.Click(); antivirusField.Click(); }
public SimulateSearchPage SimulateSearch_Page(string Terms, string productGroup) { if (!string.IsNullOrEmpty(Terms)) { CategoryField.Clear(); CategoryField.SendKeys(Terms); } if (!string.IsNullOrEmpty(productGroup)) { Select.ByText(Productgroup, productGroup); } SimulateSearch_SearchBtn.Click(); Wait.AM_Loaging_ShowAndHide(); this.VerifySimulateResult(Terms); return(this); }
public override int GetHashCode() { return(CategoryField.GetHashCode() + IdField.GetHashCode() + (InputDataFile ?? "").GetHashCode() + (ReadHeader ? 1 : 0)); }
public virtual void RemoveCategory(CategoryField category) { if (Categories.Contains(category)) Categories.Remove(category); }
/// <summary> /// Projects each category of a sequence into a new form. /// </summary> public static IQueryable <CategoryItem> Select(this IQueryable <LoggingCategory> query, CategoryField fields) { return(query.Select(p => new CategoryItem { Id = p.Id, Name = p.Name, Color = new ColorInfo { RGB = p.Color } })); }
/// <summary> /// Finds a collection of categories with the given values. /// </summary> /// <param name="user">The user for the item to be found.</param> /// <param name="project">The project for the item to be found.</param> /// <param name="orderBy">The order in which items are returned in a result set.</param> /// <param name="fields">The related fields to include in the query results.</param> /// <param name="cancellationToken">A token to observe while waiting for the task to complete.</param> /// <returns> /// A task that represents the asynchronous operation. /// </returns> public virtual Task <ListResult <CategoryItem> > FindAllAsync(AccountItem user, ProjectItem project, CategorySortOrder orderBy, CategoryField fields, CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); ThrowIfDisposed(); if (user == null) { throw new ArgumentNullException("user"); } return(Categories .Where(user.Id, project?.Id) .OrderBy(orderBy) .Select(fields) .ToListResultAsync(cancellationToken)); }
/// <summary> /// Finds a category with the given primary key value. /// </summary> /// <param name="id">The primary key for the item to be found.</param> /// <param name="fields">The related fields to include in the query results.</param> /// <param name="cancellationToken">A token to observe while waiting for the task to complete.</param> /// <returns> /// A task that represents the asynchronous operation. /// </returns> public virtual Task <CategoryItem> FindByIdAsync(int id, CategoryField fields, CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); ThrowIfDisposed(); return(Categories.Where(c => c.Id == id).Select(fields).FirstOrDefaultAsync(cancellationToken)); }
public async Task <IActionResult> Create([FromForm] CategoryField categoryField) { await _fieldRepository.AddCategoryField(categoryField); return(RedirectToAction(nameof(Index), new { id = categoryField.Id })); }
/// <summary> /// Finds a collection of categories with the given values. /// </summary> /// <param name="user">The user for the item to be found.</param> /// <param name="project">The project for the item to be found.</param> /// <param name="orderBy">The order in which items are returned in a result set.</param> /// <param name="fields">The related fields to include in the query results.</param> /// <param name="cancellationToken">A token to observe while waiting for the task to complete.</param> /// <returns> /// A task that represents the asynchronous operation. /// </returns> /// <exception cref="System.ArgumentNullException">user</exception> public virtual Task <ListResult <CategoryItem> > FindAllAsync(AccountItem user, ProjectItem project, CategorySortOrder orderBy, CategoryField fields, CancellationToken cancellationToken) { ThrowIfDisposed(); if (user == null) { throw new ArgumentNullException("user"); } return(Store.FindAllAsync(user, project, orderBy, fields, cancellationToken)); }
/// <summary> /// Finds a category with the given primary key value. /// </summary> /// <param name="id">The primary key for the item to be found.</param> /// <param name="fields">The related fields to include in the query results.</param> /// <param name="cancellationToken">A token to observe while waiting for the task to complete.</param> /// <returns> /// A task that represents the asynchronous operation. /// </returns> public virtual Task <CategoryItem> FindByIdAsync(int id, CategoryField fields, CancellationToken cancellationToken) { ThrowIfDisposed(); return(Store.FindByIdAsync(id, fields, cancellationToken)); }
public async Task AddCategoryField([NotNull] CategoryField categoryField) { await _dbContext.CategoryFields.AddAsync(categoryField); await _dbContext.SaveChangesAsync(); }