本文整理汇总了C#中ICategoryRepository类的典型用法代码示例。如果您正苦于以下问题:C# ICategoryRepository类的具体用法?C# ICategoryRepository怎么用?C# ICategoryRepository使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ICategoryRepository类属于命名空间,在下文中一共展示了ICategoryRepository类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: VotesController
public VotesController(IPollRepository PollRepository, IUserIdentityService UserIdentityService,
IUserRepository UserRepository, IVoteRepository VoteRepository, ICategoryRepository CategoryRepository)
{
if (PollRepository == null)
{
throw new ArgumentNullException("CategoryRepository");
}
if (UserIdentityService == null)
{
throw new ArgumentNullException("UserIdentityService");
}
if (UserRepository == null)
{
throw new ArgumentNullException("UserIdentityService");
}
if (VoteRepository == null)
{
throw new ArgumentNullException("VoteRepository");
}
if (CategoryRepository == null)
{
throw new ArgumentNullException("CategoryRepository");
}
this.pollRepository = PollRepository;
this.userService = UserIdentityService;
this.userRepository = UserRepository;
this.voteRepository = VoteRepository;
this.categoryRepository = CategoryRepository;
}
示例2: QuestionController
public QuestionController()
{
_questionRepo = ObjectFactory.GetInstance<IQuestionRepository>();
_categoryRepo = ObjectFactory.GetInstance<ICategoryRepository>();
_checklistRepository = ObjectFactory.GetInstance<ICheckListRepository>();
_userForAuditingRepository = ObjectFactory.GetInstance<BusinessSafe.Domain.RepositoryContracts.IUserForAuditingRepository>();
}
示例3: BaseController
protected BaseController(
ICategoryRepository catRepo,
IManufacturersRepository manufacturersRepository)
{
_catRepo = catRepo;
_manufacturersRepository = manufacturersRepository;
}
示例4: CategoryEditorViewModel
/// <summary>
/// Initializes a new instance of the CategoryEditorViewModel class.
/// </summary>
public CategoryEditorViewModel(ICategoryRepository categoryRepository)
{
CategoryRepository = categoryRepository;
Categories = new ObservableCollection<Category>(_categoryRepository.FindAll());
CategoryIds = new List<Guid>();
NotesToDelete = new List<Guid>();
NotesToTrash = new List<Guid>();
NewCategoryCommand = new RelayCommand(NewCategory, () => !OnCategoryUpdate);
DeleteCategoryCommand = new RelayCommand<object>(DeleteCategory, (noused) => OnCategoryUpdate && Categories.Count > 1);
DeleteNotesCommand = new RelayCommand<bool?>((mark) => DeleteNotesToo = mark.Value, (noused) => OnCategoryUpdate);
AcceptCategoryCommand = new RelayCommand(AcceptCategory, () => OnCategoryUpdate && IsValid);
CategoryBeenSelected = new RelayCommand(() => OnCategoryUpdate = true);
SelectBgColorCommand = new RelayCommand(SelectBgColor, () => OnCategoryUpdate);
SelectFontColorCommand = new RelayCommand(SelectFontColor, () => OnCategoryUpdate);
DefaultCategoryChangedCommand = new RelayCommand<Category>(DefaultCategoryChanged);
// We register a default message containing a string (See SavingCatOptions) below.
Messenger.Default.Register<string>(this, SavingCatOptions);
// Default category
_defaultCategory = Categories[0]; // The default one is always the first
if (!_defaultCategory.IsDefault) // first time?
_defaultCategory.IsDefault = true;
}
示例5: CategoriesParser
public CategoriesParser(ILog logger, IWebCrawler crawler, ICategoryRepository categories, IUnitOfWork uow)
{
this.logger = logger;
this.crawler = crawler;
this.categories = categories;
this.uow = uow;
}
示例6: MainViewModel
/// <summary>
/// Initializes a new instance of the MainViewModel class.
/// </summary>
public MainViewModel(IChapterRepository chapterRepository ,IBookRepository bookRepository, ICategoryRepository categoryRepository)
{
_chapterRepository = chapterRepository;
_bookRepository = bookRepository;
_categoryRepository = categoryRepository;
Chapters = new ObservableCollection<Chapter>(_chapterRepository.FindAll());
Books = new ObservableCollection<Book>(_bookRepository.FindAll());
Categories = new ObservableCollection<Category>(_categoryRepository.FindAll());
SelectedBook = new Book();
SelectedCategory = new Category();
SelectedChapter = new Chapter();
//
Books.Add(new Book(1,"Cánh đồng bất tận", "Nguyễn Ngọc Tư","2011","NXB Tuổi Trẻ",new Media(),new Media()));
Books.Add(new Book(1, "Sống để kể lại", "Nguyễn Ngọc Tư", "2011", "NXB Tuổi Trẻ", new Media(), new Media()));
Categories.Add(new Category(1, "Cuộc sống", new Media()));
Categories.Add(new Category(1, "Tình yêu", new Media()));
Categories.Add(new Category(1, "Kỹ năng", new Media()));
Chapters.Add(new Chapter(1, "Giới thiệu sách nói", new Media(), new Media()));
Chapters.Add(new Chapter(1, "Trở thành biên tập viên ở El Espectador", new Media(), new Media()));
Chapters.Add(new Chapter(1, "Thử lửa với công việc phóng viên xung kích", new Media(), new Media()));
Chapters.Add(new Chapter(1, "Công việc viết phê bình điện ảnh", new Media(), new Media()));
}
示例7: HomeController
public HomeController(ICategoryRepository categoryRepository, IProductRepository productRepository,
IConstants constants)
{
_categoryRepository = categoryRepository;
_productRepository = productRepository;
_constants = constants;
}
示例8: AnalyticsController
public AnalyticsController(ISubCategoryRepository repo, ICategoryRepository repoCat,IUserRepository repoUser,IQuizRepository repoQuiz)
{
_repo = repo;
_repoCat = repoCat;
_repoUser = repoUser;
_repoQuiz = repoQuiz;
}
示例9: DishService
public DishService(IDishRepository dishRepository, ICategoryRepository categoryRepository, IMarkupRepository markupRepository, IUnitOfWork unitOfWork)
{
_dishRepository = dishRepository;
_categoryRepository = categoryRepository;
_markupRepository = markupRepository;
_unitOfWork = unitOfWork;
}
示例10: ProductCatalogService
public ProductCatalogService(IProductTitleRepository productTitleRepository, IProductRepository productRepository,
ICategoryRepository categoryRepository)
{
_productTitleRepository = productTitleRepository;
_productRepository = productRepository;
_categoryRepository = categoryRepository;
}
示例11: MainViewModel
/// <summary>
/// Initializes a new instance of the MainViewModel class.
/// </summary>
public MainViewModel(INoteRepository noteRepository, ICategoryRepository categoryRepository)
{
_noteRepository = noteRepository;
_categoryRepository = categoryRepository;
Notes = new ObservableCollection<Note>(_noteRepository.FindAll());
Categories = new ObservableCollection<Category>(_categoryRepository.FindAll());
// Is there categories list empty?
if (Categories.Count == 0)
{
// In this case, I will create a default category with a welcome note
var cat = new Category(Resources.Strings.GeneralCat, "#33CC00", "#FFFFFF");
Categories.Add(cat);
_categoryRepository.SaveAll(Categories);
var note = new Note(Resources.Strings.WelcomeMessage, cat);
Notes.Add(note);
_noteRepository.Save(note);
}
ActualNote = new Note();
SelectedCategory = _categories[0]; // We need to this for Category's ComboBox sake.
Trash = new Category("Trash", "#f8f8f8", "#777777");
AddNoteCommand = new RelayCommand(AddNote, CanAddNote);
EditNoteCommand = new RelayCommand<Note>(EditNote);
DeleteNoteCommand = new RelayCommand<Note>(DeleteNote);
DeleteAllNotesCommand = new RelayCommand(DeleteAllNotes);
CategoryOptionsCommand = new RelayCommand(OpenCategoryOptions);
// We expect a message with some lists with changes.
Messenger.Default.Register<CategoryEditorChangesMessage>(this, MakingNewCatChanges);
}
示例12: ProductController
public ProductController(IProductRepository productRepo,
ICategoryRepository categoryRepo)
{
_categoryRepo = categoryRepo;
_productRepo = productRepo;
PageSize = 5;
}
示例13: PollsApiController
public PollsApiController(IPollRepository PollRepository, ICategoryRepository CategoryRepository, IFrequencyRepository FrequencyRepository, IUserIdentityService UserIdentityService, IUserRepository UserRepository)
{
if (PollRepository == null)
{
throw new ArgumentNullException("CategoryRepository");
}
if (CategoryRepository == null)
{
throw new ArgumentNullException("CategoryRepository");
}
if (FrequencyRepository == null)
{
throw new ArgumentNullException("CategoryRepository");
}
if (UserIdentityService == null)
{
throw new ArgumentNullException("UserIdentityService");
}
if (UserRepository == null)
{
throw new ArgumentNullException("UserIdentityService");
}
this.pollRepository = PollRepository;
this.categoryRepository = CategoryRepository;
this.frequencyRepository = FrequencyRepository;
this.userService = UserIdentityService;
this.userRepository = UserRepository;
}
示例14: SelectCategoryListViewModel
/// <summary>
/// Creates an CategoryListViewModel for the usage of providing a CategoryViewModel selection.
/// </summary>
/// <param name="categoryRepository">An instance of <see cref="IRepository{T}" />.</param>
/// <param name="modifyDialogService">An instance of <see cref="IModifyDialogService" /></param>
/// <param name="dialogService">An instance of <see cref="IDialogService" /></param>
/// <param name="messenger">An instance of <see cref="IMvxMessenger" /></param>
public SelectCategoryListViewModel(ICategoryRepository categoryRepository,
IModifyDialogService modifyDialogService,
IDialogService dialogService, IMvxMessenger messenger)
: base(categoryRepository, modifyDialogService, dialogService)
{
this.messenger = messenger;
}
示例15: TransactionApp
public TransactionApp(ITransactionRepository transactionRepository, IAccountRepository accountRepository, ICategoryRepository categoryRepository, IPropertyRepository propertyRepository)
{
_transactionRepository = transactionRepository;
_accountRepository = accountRepository;
_categoryRepository = categoryRepository;
_propertyRepository = propertyRepository;
}