本文整理汇总了C#中IRepositoryFactory类的典型用法代码示例。如果您正苦于以下问题:C# IRepositoryFactory类的具体用法?C# IRepositoryFactory怎么用?C# IRepositoryFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IRepositoryFactory类属于命名空间,在下文中一共展示了IRepositoryFactory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PropertyViewModel
public PropertyViewModel(IViewModelsFactory<IPropertyValueViewModel> propertyValueVmFactory, IViewModelsFactory<IPropertyAttributeViewModel> attributeVmFactory, ICatalogEntityFactory entityFactory, Property item, catalogModel.Catalog parentCatalog, IRepositoryFactory<ICatalogRepository> repositoryFactory, ObservableCollection<Property> properties)
{
InnerItem = item;
_propertyValueVmFactory = propertyValueVmFactory;
_attributeVmFactory = attributeVmFactory;
_entityFactory = entityFactory;
_properties = properties;
ParentCatalog = parentCatalog;
// _repositoryFactory = repositoryFactory;
ValueAddCommand = new DelegateCommand(RaiseValueAddInteractionRequest);
ValueEditCommand = new DelegateCommand<PropertyValueBase>(RaiseValueEditInteractionRequest, x => x != null);
ValueDeleteCommand = new DelegateCommand<PropertyValueBase>(RaiseValueDeleteInteractionRequest, x => x != null);
AttributeAddCommand = new DelegateCommand(RaiseAttributeAddInteractionRequest);
AttributeEditCommand = new DelegateCommand<PropertyAttribute>(RaiseAttributeEditInteractionRequest, x => x != null);
AttributeDeleteCommand = new DelegateCommand<PropertyAttribute>(RaiseAttributeDeleteInteractionRequest, x => x != null);
CommonConfirmRequest = new InteractionRequest<Confirmation>();
var allValueTypes = (PropertyValueType[])Enum.GetValues(typeof(PropertyValueType));
PropertyTypes = new List<PropertyValueType>(allValueTypes);
PropertyTypes.Sort((x, y) => x.ToString().CompareTo(y.ToString()));
}
示例2: FirstNRequests
/// <summary>
/// Take first N request.
/// </summary>
/// <param name="n">number of requests</param>
public static List<Request> FirstNRequests(IRepositoryFactory factory, int n)
{
return factory.RequestRepository.Get()
.OrderByDescending(r => r.Date)
.Take(n)
.ToList();
}
示例3: NotificationServiceTests
public NotificationServiceTests()
{
EmailRepository = MockRepository.GenerateStub<IRepositoryWithTypedId<EmailQueue, Guid>>();
EmailPreferenceRepository = MockRepository.GenerateStub < IRepositoryWithTypedId<EmailPreferences, string>>();
UserIdentity = MockRepository.GenerateStub<IUserIdentity>();
UserRepository = MockRepository.GenerateStub<IRepositoryWithTypedId<User, string>>();
OrderStatusCodeRepository = MockRepository.GenerateStub<IRepositoryWithTypedId<OrderStatusCode, string>>();
ServerLink = MockRepository.GenerateStub<IServerLink>();
QueryRepositoryFactory = MockRepository.GenerateStub<IQueryRepositoryFactory>();
RepositoryFactory = MockRepository.GenerateStub<IRepositoryFactory>();
RepositoryFactory.OrganizationRepository =
MockRepository.GenerateStub<IRepositoryWithTypedId<Organization, string>>();
AdminWorkgroupRepository = MockRepository.GenerateStub<IRepository<AdminWorkgroup>>();
QueryRepositoryFactory.AdminWorkgroupRepository = AdminWorkgroupRepository;
WorkgroupRepository = MockRepository.GenerateStub<IRepository<Workgroup>>();
RepositoryFactory.WorkgroupRepository = WorkgroupRepository;
NotificationService = new NotificationService(EmailRepository, EmailPreferenceRepository, UserRepository, OrderStatusCodeRepository, UserIdentity, ServerLink, QueryRepositoryFactory, RepositoryFactory);
ServerLink.Expect(a => a.Address).Return("FakeHost").Repeat.Any();
ApprovalRepository = MockRepository.GenerateStub<IRepository<Approval>>();
SetupOrderStatusCodes();
}
示例4: MainFulfillmentViewModel
public MainFulfillmentViewModel(
IInventoryHomeViewModel inventoryVm,
IPicklistHomeViewModel picklistVm,
IRmaHomeViewModel rmaVm,
IViewModelsFactory<ICompleteShipmentViewModel> completeShipmentVmFactory,
IRepositoryFactory<IOrderRepository> orderRepositoryFactory,
IOrderService orderService,
IAuthenticationContext authContext)
{
ViewTitle = new ViewTitleBase { Title = "Fulfillment", SubTitle = "FULFILLMENT SERVICE" };
_inventoryHomeVm = inventoryVm;
_inventoryHomeVm.ParentViewModel = this;
_picklistHomeVm = picklistVm;
_picklistHomeVm.ParentViewModel = this;
_rmaHomeVm = rmaVm;
_rmaHomeVm.ParentViewModel = this;
_completeShipmentVmFactory = completeShipmentVmFactory;
_orderRepositoryFactory = orderRepositoryFactory;
_authContext = authContext;
_orderService = orderService;
PopulateTabItems();
CompleteShipmentCommand = new DelegateCommand(RaiseCompleteShipment);
CommonConfirmRequest = new InteractionRequest<Confirmation>();
CommonNotifyRequest = new InteractionRequest<Notification>();
}
示例5: ViewModelFactory
public ViewModelFactory(IRepositoryFactory repositoryFactory, IImportManagerFactory importManagerFactory)
{
repositoryFactory.ThrowIfNull("repositoryFactory");
importManagerFactory.ThrowIfNull("importManagerFactory");
this.repositoryFactory = repositoryFactory;
this.importManagerFactory = importManagerFactory;
}
示例6: TasksModel
public TasksModel(ISourceControl sourceControl, IIssuesTracking issuesTracking, IRepositoryFactory repositoryFactory)
{
_sourceControl = sourceControl;
_issuesTracking = issuesTracking;
_repositoryFactory = repositoryFactory;
LoadModels();
}
示例7: ConfigSetTask
public ConfigSetTask(IRepositoryFactory repositoryFactory, IEnvironmentTasks environmentTasks)
{
this.cacheController = cacheController;
this.environmentTasks = environmentTasks;
Repository = repositoryFactory.GetRepository();
Repository.SavingChanges += SavingChanges;
}
示例8: Create
public static GenotypingViewModel Create(IRepositoryFactory repositoryFactory, User user, JobType jobType = null, GenotypingPostModel postModel = null)
{
var viewModel = new GenotypingViewModel()
{
JobType = jobType,
JobTypes = jobType == null ? repositoryFactory.JobTypeRepository.Queryable.Where(a => a.Genotyping).ToList() : new List<JobType>(),
PostModel = postModel ?? new GenotypingPostModel() {NumPlates = 1}
};
if (jobType != null)
{
var rid = postModel != null && postModel.RechargeAccount != null ? postModel.RechargeAccount.Id : -1;
viewModel.RechargeAccounts = new SelectList(user.RechargeAccounts, "Id", "AccountNum", rid);
var pts = new List<SelectListItem>();
pts.Add(new SelectListItem() { Value = ((int)Core.Resources.PlateTypes.NinetySix).ToString(), Text = EnumUtility.GetEnumDescription(Core.Resources.PlateTypes.NinetySix) });
pts.Add(new SelectListItem() { Value = ((int)Core.Resources.PlateTypes.ThreeEightyFour).ToString(), Text = EnumUtility.GetEnumDescription(Core.Resources.PlateTypes.ThreeEightyFour) });
viewModel.PlateTypes = new SelectList(pts, "Value", "Text");
var did = postModel != null && postModel.Dyes != null ? postModel.Dyes : new List<int>();
viewModel.Dyes = new MultiSelectList(repositoryFactory.DyeRepository.Queryable.Where(a => a.Genotyping), "Id", "Name", did);
}
return viewModel;
}
示例9: UserService
public UserService(IRepositoryFactory _repositoryFactory, IHraSessionManager hraSessionManger)
{
this._repositoryFactory = _repositoryFactory;
_hraSessionManager = hraSessionManger;
sample = new SampleData();
}
示例10: WorkgroupServiceTests
public WorkgroupServiceTests()
{
AutomapperConfig.Configure();
VendorRepository = MockRepository.GenerateStub<IRepositoryWithTypedId<Vendor, string>>();
VendorAddressRepository = MockRepository.GenerateStub<IRepositoryWithTypedId<VendorAddress, Guid>>();
UserRepository = MockRepository.GenerateStub<IRepositoryWithTypedId<User, string>>();
EmailPreferencesRepository = MockRepository.GenerateStub<IRepositoryWithTypedId<EmailPreferences, string>>();
WorkgroupPermissionRepository = MockRepository.GenerateStub<IRepository<WorkgroupPermission>>();
WorkgroupRepository = MockRepository.GenerateStub<IRepository<Workgroup>>();
OrganizationRepository = MockRepository.GenerateStub<IRepositoryWithTypedId<Organization, string>>();
SearchService = MockRepository.GenerateStub<IDirectorySearchService>();
RepositoryFactory = MockRepository.GenerateStub<IRepositoryFactory>();
RepositoryFactory.RoleRepository = MockRepository.GenerateStub<IRepositoryWithTypedId<Role, string>>();
RepositoryFactory.WorkgroupPermissionRepository = WorkgroupPermissionRepository;
RepositoryFactory.AccountRepository = MockRepository.GenerateStub<IRepositoryWithTypedId<Account, string>>();
QueryRepositoryFactory = MockRepository.GenerateStub<IQueryRepositoryFactory>();
UserIdentity = MockRepository.GenerateStub<IUserIdentity>();
QueryRepositoryFactory.RelatatedWorkgroupsRepository =
MockRepository.GenerateStub<IRepository<RelatedWorkgroups>>();
WorkgroupService = new WorkgroupService(VendorRepository,
VendorAddressRepository,
UserRepository,
EmailPreferencesRepository,
WorkgroupPermissionRepository,
WorkgroupRepository,
OrganizationRepository,
SearchService,
RepositoryFactory, QueryRepositoryFactory, UserIdentity);
}
示例11: DisplayTemplateOverviewStepViewModel
public DisplayTemplateOverviewStepViewModel(
IRepositoryFactory<IAppConfigRepository> repositoryFactory,
IAppConfigEntityFactory entityFactory,
DisplayTemplateMapping item)
: base(null, repositoryFactory, entityFactory, null, null, item)
{
}
示例12: TableStorageContextFactory
public TableStorageContextFactory(
ICloudStorageServices cloudStorageServices,
IRepositoryFactory repositoryFactory)
{
this.cloudStorageServices = cloudStorageServices;
this.repositoryFactory = repositoryFactory;
}
示例13: HomeController
public HomeController(IRepositoryFactory repositoryFactory, IMapDataService mapService)
{
Contract.Requires(repositoryFactory != null);
Contract.Requires(mapService != null);
_repositoryFactory = repositoryFactory;
_mapService = mapService;
}
示例14: ImportService
public ImportService(IImportRepository importRepository, IAssetService blobProvider, ICatalogRepository catalogRepository, IOrderRepository orderRepository, IAppConfigRepository appConfigRepository, IRepositoryFactory<IAppConfigRepository> appConfigRepositoryFactory)
{
_orderRepository = orderRepository;
_catalogRepository = catalogRepository;
_importJobRepository = importRepository;
_appConfigRepository = appConfigRepository;
_appConfigRepositoryFactory = appConfigRepositoryFactory;
_assetProvider = blobProvider;
_entityImporters = new List<IEntityImporter>
{
new ItemImporter() { Name = "Product"},
new ItemImporter() { Name = "Sku"},
new ItemImporter() { Name = "Bundle"},
new ItemImporter() { Name = "DynamicKit"},
new ItemImporter() { Name = "Package"},
new PriceImporter(_catalogRepository),
new AssociationImporter(_catalogRepository),
new RelationImporter(_catalogRepository),
new CategoryImporter(),
new LocalizationImporter(),
new TaxValueImporter(),
new ItemAssetImporter(),
new TaxCategoryImporter(),
new JurisdictionImporter(),
new JurisdictionGroupImporter(),
new SeoImporter()
};
_importResults = new Dictionary<string, ImportResult>();
}
示例15: SynchronizationService
public SynchronizationService(IRepositoryFactory repositoryFactory)
{
_repositoryFactory = repositoryFactory;
_resolver.Add(SynchronizationType.Get, Get);
_resolver.Add(SynchronizationType.Post, Post);
_resolver.Add(SynchronizationType.Both, Both);
}