public ContactEditorViewModel(ICommandInvoker commandInvoker, IQueryInvoker queryInvoker) { this.queryInvoker = queryInvoker; Contacts = queryInvoker.Query<AllContactsQueryResult>().Contacts; SaveCommand = new DelegateCommand(() => { if (CurrentContact.Command is UpdateContactCommand) { commandInvoker.Execute<UpdateContactCommand, UpdateContactQueryResult>((UpdateContactCommand) CurrentContact.Command); } else { commandInvoker.Execute<CreateContactCommand, CreateContactQueryResult>(CurrentContact.Command); } Contacts = queryInvoker.Query<AllContactsQueryResult>().Contacts; }); NewCommand = new DelegateCommand(() => { var modifyContactQueryResult = queryInvoker.Query<CreateContactQueryResult>(); CurrentContact = new CreateContactViewModel(modifyContactQueryResult, new ValidationService()); }); NewCommand.Execute(null); }
public ContactController() { // You'd really DI this is from autofac. var contactService = new ContactService(new CountyRepository(), new CountryRepository(), new ContactRepository(), new ValidationService(), new ContactAdministrationService(new CountyRepository(), new CountryRepository(), new ContactRepository())); commandInvoker = new CommandInvoker(contactService); queryInvoker = new QueryInvoker(contactService); }
/// <summary> /// Controller to manage order entities. /// </summary> public OrdersController(ICommandInvoker commandInvoker, IQueryInvoker queryInvoker, IMapper mapper) { _commandInvoker = commandInvoker; _queryInvoker = queryInvoker; _mapper = mapper; }
protected QueryController(IQueryInvoker queryInvoker) { this.queryInvoker = queryInvoker; }
public MenuQueryHandler(IQueryInvoker queryInvoker) { this.query = queryInvoker; }
public TestQueryController(IQueryInvoker commandInvoker) : base(commandInvoker) { }
public PropertyQueryHandler(IQueryInvoker queryInvoker) { this.query = queryInvoker; }
/// <summary> /// Controller to manage inventory entities: articles, bill of materials and spoilage. /// </summary> /// <param name="commandInvoker"></param> /// <param name="queryInvoker"></param> /// <param name="mapper"></param> public InventoryController(ICommandInvoker commandInvoker, IQueryInvoker queryInvoker, IMapper mapper) { _commandInvoker = commandInvoker; _queryInvoker = queryInvoker; _mapper = mapper; }
/// <summary> /// Controller to manage shop category entities. /// </summary> public ShopCategoriesController(ICommandInvoker commandInvoker, IQueryInvoker queryInvoker, IMapper mapper) { _commandInvoker = commandInvoker; _queryInvoker = queryInvoker; _mapper = mapper; }