public void AddCategory(Category c) { if (!Categories.Contains(c)) { Categories.Add(c); } }
public void Can_Get_Cat() { EFUnitOfWork ef = new EFUnitOfWork(); var sample = new Category() { Name = "yura skaki" }; ef.Categories.Create(sample); Assert.NotNull(ef.Categories.GetAll()); }
public void UpdateCategoryPicture(Category category) { if (category == null) { return; } using (var connection = this.GetConnection()) { var categoryQueryObject = new CategoryQueryObject(); connection.Execute(categoryQueryObject.UpdateCategoryImage(category.CategoryID, category.Picture)); } }
public void Initialize(Category c = null) { Categories.Clear(); if (c == null) { foreach (CategoryViewMapping i in Db.Instance.CVMappings.Mappings) { if (Guid.Equals(i.ViewId.Value, this.Id)) { AddCategory(i.Category); } } } else { AddCategory(c); } }