public static bool IsCategorySlugInUse(string slug, string bvin, Catalog.CategoryRepository repository) { Catalog.Category c = repository.FindBySlug(slug); if (c != null) { if (c.Bvin != string.Empty) { if (c.Bvin != bvin) { return true; } } } return false; }