本文整理汇总了C#中ICustomerRepository类的典型用法代码示例。如果您正苦于以下问题:C# ICustomerRepository类的具体用法?C# ICustomerRepository怎么用?C# ICustomerRepository使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ICustomerRepository类属于命名空间,在下文中一共展示了ICustomerRepository类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Init
public void Init()
{
Mock<ICustomerRepository<CustomerModel>> mockCustomerRepository = new Mock<ICustomerRepository<CustomerModel>>();
Mock<IEngineerRepository<EngineerModel>> mockEngineerRepository = new Mock<IEngineerRepository<EngineerModel>>();
Mock<IInstallationRepository<InstallationModel>> mockInstallationRepository = new Mock<IInstallationRepository<InstallationModel>>();
List<EngineerModel> engineers = new List<EngineerModel>
{
new EngineerModel {engineerid=0, firstname="Karl", lastname="Maier", password="test123",email="[email protected]", username="karli"}
};
List<InstallationModel> installations = new List<InstallationModel>
{
new InstallationModel { installationid= 0, customerid=0, description="test", latitude=44, longitude=55, Measurement= new List<int>{0}, serialno="serial"}
};
List<CustomerModel> customers = new List<CustomerModel>
{
new CustomerModel { customerid=0, engineerid=0, firstname="Anton", lastname="Huber", password="test",email="[email protected]", username="toni", Installation=new List<int> {0}}
};
mockCustomerRepository.Setup(mr => mr.GetAll()).Returns(customers);
mockCustomerRepository.Setup(mr => mr.GetById(It.IsAny<int>())).Returns((int customerid) => customers.Where(customer => customer.customerid == customerid).Single());
mockCustomerRepository.Setup(mr => mr.Add(It.IsAny<CustomerModel>())).Callback((CustomerModel customer) => customers.Add(customer));
mockInstallationRepository.Setup(mr => mr.GetByCustomerId(It.IsAny<int>())).Returns((int customerid) => installations.Where(installation => installation.customerid == customerid).ToList<InstallationModel>());
mockInstallationRepository.Setup(mr => mr.Add(It.IsAny<InstallationModel>())).Callback((InstallationModel installation) => installations.Add(installation));
mockInstallationRepository.Setup(mr => mr.GetAll()).Returns(installations);
mockEngineerRepository.Setup(mr => mr.GetMyCustomers(It.IsAny<int>())).Returns((int id) => customers.Where(customer => customer.engineerid == id).ToList<CustomerModel>());
this.mockcrepo = mockCustomerRepository.Object;
this.mockirepo = mockInstallationRepository.Object;
this.mockerepo = mockEngineerRepository.Object;
}
开发者ID:daniel9992000,项目名称:bif5-sks-csharp,代码行数:31,代码来源:EngineerBLTest.cs
示例2: CartController
public CartController(ICustomerRepository customerRepository,
IProductRepository productRepository)
: base(customerRepository)
{
_productRepository = productRepository;
_customerRepository = customerRepository;
}
开发者ID:JawariSanga,项目名称:Main,代码行数:7,代码来源:CartController.cs
示例3: VehicleEditorModel
public VehicleEditorModel(ICustomerRepository customerRepository, IVehicleGroupRepository vehicleGroupRepository,
IVehicleRepository vehicleRepository,
IVehicleDetailRepository vehicleDetailRepository, IVehicleWheelRepository vehicleWheelRepository,
ISparepartRepository sparepartRepository, ITypeRepository typeRepository,
ISpecialSparepartDetailRepository wheelDetailRepository, IBrandRepository brandRepository,
ISparepartDetailRepository sparepartDetailRepository,
ISpecialSparepartDetailRepository specialSparepartDetailRepository,
ISparepartStockCardRepository sparepartStokCardRepository,
IReferenceRepository referenceRepository,
IUnitOfWork unitOfWork)
: base()
{
_customerRepository = customerRepository;
_vehicleGroupRepository = vehicleGroupRepository;
_vehicleRepository = vehicleRepository;
_vehicleDetailRepository = vehicleDetailRepository;
_vehicleWheelRepository = vehicleWheelRepository;
_specialSparepartDetailRepository = wheelDetailRepository;
_sparepartDetailRepository = sparepartDetailRepository;
_sparepartRepository = sparepartRepository;
_typeRepository = typeRepository;
_brandRepository = brandRepository;
_sparepartStokCardRepository = sparepartStokCardRepository;
_referenceRepository = referenceRepository;
_unitOfWork = unitOfWork;
}
开发者ID:edwinsyarief,项目名称:Brawijaya-Workshop-Solution,代码行数:26,代码来源:VehicleEditorModel.cs
示例4: RentalAgreementService
public RentalAgreementService(IRentalAgreementRepository theRentalAgreementRepository,
ICustomerRepository theCustomerRepository, IUserRepository theUserRepository)
{
_rentalAgreementRepository = theRentalAgreementRepository;
_customerRepository = theCustomerRepository;
_userRepository = theUserRepository;
}
开发者ID:gblosser,项目名称:FullStackReference,代码行数:7,代码来源:RentalAgreementService.cs
示例5: CostAnalyzerController
/// <summary>
///
/// </summary>
/// <param name="custRepo"></param>
/// <param name="modifiedCustRepository"></param>
/// <param name="vesselRepo"></param>
public CostAnalyzerController(IRepository<customer> custRepo, ICustomerRepository modifiedCustRepository, IRepository<vessel> vesselRepo, ICostAnalyzerService costAnalyzerService)
{
this.customerRepository = custRepo;
this.modifiedCustRepository = modifiedCustRepository;
this.vesselRepository = vesselRepo;
this.costAnalyzerService = costAnalyzerService;
}
开发者ID:amodedude,项目名称:RTI-Web-Applicaotin,代码行数:13,代码来源:CostAnalyzerController.cs
示例6: GetCustomerRepo
public static ICustomerRepository GetCustomerRepo()
{
if (customerRepo == null)
customerRepo = new CustomerRepository();
return customerRepo;
}
开发者ID:mchambers,项目名称:Daremeto,代码行数:7,代码来源:RepoFactory.cs
示例7: IntegrationModule
public IntegrationModule(ICustomerRepository customers, IClientRepository clients)
{
Get["/Integration/ClientCustomerContracts/All"] = param =>
{
var result = new List<IntegrationClientDto>();
var clientContracts = clients.ToList().Select(
s =>
new IntegrationClientDto(s.Id, s.Name, s.ClientAccountNumber.ToString(), s.IsActive,
s.Contracts
.Select(c => new IntegrationContractDto(c.Id, c.Name, c.Packages
.Select(p => new PackageDto() {PackageId = p.PackageId, Name = p.Name, IsActive = p.IsActive}))))).ToList();
result.AddRange(clientContracts.Where(w => w.Contracts.Any()));
var customerContracts = customers.ToList().Select(
s =>
new IntegrationClientDto(s.Id, s.Name, s.CustomerAccountNumber.ToString(), s.IsActive,
s.Contracts.Select(c => new IntegrationContractDto(c.Id, c.Name, c.Packages
.Select(p => new PackageDto() { Id = p.Id, PackageId = p.PackageId, Name = p.Name, IsActive = p.IsActive}))))).ToList();
result.AddRange(customerContracts.Where(w => w.Contracts.Any()));
return Response.AsJson(result);
};
}
开发者ID:rjonker1,项目名称:lightstone-data-platform,代码行数:25,代码来源:IntegrationModule.cs
示例8: BeforeEach
public void BeforeEach()
{
_productRepo = Substitute.For<IProductRepository>();
_orderFulfillmentService = Substitute.For<IOrderFulfillmentService>();
_customerRepository = Substitute.For<ICustomerRepository>();
_taxRateService = Substitute.For<ITaxRateService>();
_emailService = Substitute.For<IEmailService>();
_subject = new OrderService(_orderFulfillmentService,
_customerRepository,
_taxRateService,
_emailService);
_bestCustomer = new Customer
{
CustomerId = 42,
PostalCode = "12345",
Country = "Merica"
};
_listOfTaxEntries = new List<TaxEntry>
{
new TaxEntry {Description = "High Tax", Rate = (decimal) 0.60},
new TaxEntry {Description = "Low Tax", Rate = (decimal) 0.10}
};
_orderConfirmation = new OrderConfirmation
{
OrderId = 1234,
OrderNumber = "hello"
};
_customerRepository.Get(_bestCustomer.CustomerId.Value).Returns(_bestCustomer);
_taxRateService.GetTaxEntries(_bestCustomer.PostalCode, _bestCustomer.Country).Returns(_listOfTaxEntries);
}
开发者ID:brntsllvn,项目名称:OrderEntryMockingPracticeOLD,代码行数:34,代码来源:OrderServiceTests.cs
示例9: CustomerService
public CustomerService(ICustomerRepository customerRepository, IUnitOfWork unitOfWork)
{
if (customerRepository == null) throw new ArgumentNullException("Customer repo");
if (unitOfWork == null) throw new ArgumentNullException("Unit of work");
_customerRepository = customerRepository;
_unitOfWork = unitOfWork;
}
开发者ID:cleancodenz,项目名称:MVC4DEV,代码行数:7,代码来源:CustomerService.cs
示例10: CustomerService
public CustomerService(
ICustomerRepository customerRepository,
ICustomerFullNameBuilder customerFullName)
{
_customerRepository = customerRepository;
_customerFullName = customerFullName;
}
开发者ID:exploitx3,项目名称:HighQualityCode,代码行数:7,代码来源:CustomerService.cs
示例11: UserService
public UserService(IUserAccountRepository userAccountRepository, ICustomerRepository customerRepository, IUserRoleRepository userRoleRepository, IRoleRepository roleRepository)
{
_customerRepository = customerRepository;
_userRoleRepository = userRoleRepository;
_roleRepository = roleRepository;
_userAccountRepository = userAccountRepository;
}
开发者ID:ngnono,项目名称:NG.FM,代码行数:7,代码来源:UserService.cs
示例12: CustomerService_9
public CustomerService_9(ICustomerRepository customerRepository, IMailingRepository mailingRepository)
{
_customerRepository = customerRepository;
_mailingRepository = mailingRepository;
_customerRepository.NotifySalesTeam += _customerRepository_NotifySalesTeam;
}
开发者ID:mkhodary,项目名称:Mocking_Samples_With_Moq,代码行数:7,代码来源:9_Events.cs
示例13: CustomerService
public CustomerService(
ICustomerRepository customerRepository,
IIdFactory idFactory)
{
_customerRepository = customerRepository;
_idFactory = idFactory;
}
开发者ID:exploitx3,项目名称:HighQualityCode,代码行数:7,代码来源:CustomerService.cs
示例14: OrderController
public OrderController(ICustomerRepository customerRepository,
IOrderRepository orderRepository)
: base(customerRepository)
{
_orderRepository = orderRepository;
_customerRepository = customerRepository;
}
开发者ID:RayLiu1106,项目名称:TailspinDemo,代码行数:7,代码来源:OrderController.cs
示例15: CustomerFacade
public CustomerFacade(ICustomerRepository customerRepository, IAddressRepository addressRepository, IAuth auth, IPasswordHandler passwordHandler)
{
_customerRepository = customerRepository;
_addressRepository = addressRepository;
_auth = auth;
_passwordHandler = passwordHandler;
}
开发者ID:SamoZabo,项目名称:NackademiskaAuction,代码行数:7,代码来源:CustomerFacade.cs
示例16: ConductivityController
/// <summary>
/// ConductivityController controller
/// </summary>
/// <param name="modifiedCondRepository">modified Conductivity Repository</param>
/// <param name="CondClient">Conductivity Client</param>
public ConductivityController(IConductivityRepository modifiedCondRepository, IConductivityService CondClient, IRepository<customer> custRepo, ICustomerRepository modifiedCustRepository)
{
this.modifiedCondRepository = modifiedCondRepository;
this.conductivityService = CondClient;
this.customerRepository = custRepo;
this.modifiedCustRepository = modifiedCustRepository;
}
开发者ID:amodedude,项目名称:RTI-App,代码行数:12,代码来源:ConductivityController.cs
示例17: CustomerController
public CustomerController(ICustomerRepository customerRepository, INotificationProvider notificationProvider, IOrderRepository ordersRepository, ILogger logger)
{
_customerRepository = customerRepository;
_notificationProvider = notificationProvider;
_ordersRepository = ordersRepository;
_logger = logger;
}
开发者ID:KalyanArangam,项目名称:SSWTV.DevSuperPower.DI,代码行数:7,代码来源:CustomerController.cs
示例18: OrderService
public OrderService(IOrderRepository orderRepository, IBasketRepository basketRepository, ICustomerRepository customerRepository, IUnitOfWork uow)
{
_customerRepository = customerRepository;
_orderRepository = orderRepository;
_basketRepository = basketRepository;
_uow = uow;
}
开发者ID:robertnadar,项目名称:AspNetDesign,代码行数:7,代码来源:OrderService.cs
示例19: CustomerController
public CustomerController(WorkspaceController workspaces, CommandController commands,
ICustomerRepository customerRepository)
{
_workspaces = workspaces;
_commands = commands;
_customerRepository = customerRepository;
}
开发者ID:Raconeisteron,项目名称:bakopanos,代码行数:7,代码来源:CustomerController.cs
示例20: Context
protected override void Context()
{
MockAuthorizationService = MockRepository.GenerateStub<IAuthorizationService>();
MockDocumentRepository = MockRepository.GenerateStub<IDocumentRepository>();
MockCustomerRepository = MockRepository.GenerateStub<ICustomerRepository>();
//DocumentService = new DocumentService(MockAuthorizationService, MockDocumentRepository, MockCustomerRepository);
}
开发者ID:AcklenAvenue,项目名称:PRTools,代码行数:7,代码来源:given_a_document_service_context.cs
注:本文中的ICustomerRepository类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论