private bool NeedsWashing(ClothingArticle clothingArticle)
        {
            if (clothingArticle.IsDirty) return true;

            var wearLimitBeforeWashing = _wearLimitPolicy.GetWearLimitBeforeWashing(clothingArticle.Type);
            return clothingArticle.TimesWornSinceLastWash >= wearLimitBeforeWashing;
        }
        public void UpdateClothingArticle(ClothingArticle clothingArticle)
        {
            var filter = IdFilterDefinition(clothingArticle.Id);

            _clothingArticles.ReplaceOneAsync(filter, clothingArticle).Wait();
        }
 public void StoreClothingArticle(ClothingArticle clothingArticle)
 {
     _clothingArticles.InsertOneAsync(clothingArticle).Wait();
 }
        public void RemoveClothingArticle(ClothingArticle clothingArticle)
        {
            var filter = IdFilterDefinition(clothingArticle.Id);

            _clothingArticles.DeleteOneAsync(filter).Wait();
        }
 private bool ClothingArticleExistsInRepository(ClothingArticle clothingArticle)
 {
     return _unitOfWork.ClothesRepository.RetrieveClothingArticleById(clothingArticle.Id) != null;
 }
 public void RemoveClothingArticle(ClothingArticle clothingArticle)
 {
     _context.Clothes.Remove(clothingArticle);
 }
 public void UpdateClothingArticle(ClothingArticle clothingArticle)
 {
     _context.Entry(clothingArticle).State = EntityState.Modified;
 }
 public void StoreClothingArticle(ClothingArticle clothingArticle)
 {
     _context.Clothes.Add(clothingArticle);
 }