当前位置: 首页>>代码示例>>C#>>正文


C# IMappingEngine类代码示例

本文整理汇总了C#中IMappingEngine的典型用法代码示例。如果您正苦于以下问题:C# IMappingEngine类的具体用法?C# IMappingEngine怎么用?C# IMappingEngine使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


IMappingEngine类属于命名空间,在下文中一共展示了IMappingEngine类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Context

        protected override void Context()
        {
            AccountService = MockRepository.GenerateStub<IAccountService>();

            Identity = new FakeIdentity(Username);
            _user = new FakePrincipal(Identity, null);

            HttpRequest = MockRepository.GenerateStub<HttpRequestBase>();
            HttpContext = MockRepository.GenerateStub<HttpContextBase>();
            HttpContext.Stub(x => x.Request).Return(HttpRequest);
            HttpContext.User = _user;

            _httpResponse = MockRepository.GenerateStub<HttpResponseBase>();
            _httpResponse.Stub(x => x.Cookies).Return(new HttpCookieCollection());
            HttpContext.Stub(x => x.Response).Return(_httpResponse);

            Logger = MockRepository.GenerateStub<ILogger>();
            WebAuthenticationService = MockRepository.GenerateStub<IWebAuthenticationService>();

            MappingEngine = MockRepository.GenerateStub<IMappingEngine>();
            AccountCreator = MockRepository.GenerateStub<IAccountCreator>();

            AccountController = new AccountController(AccountService, Logger, WebAuthenticationService, MappingEngine, null, AccountCreator);
            AccountController.ControllerContext = new ControllerContext(HttpContext, new RouteData(), AccountController);
        }
开发者ID:AcklenAvenue,项目名称:PRTools,代码行数:25,代码来源:given_an_account_controller_context.cs

示例2: MyAccountViewModelBuilder

 public MyAccountViewModelBuilder(string userEmail, ICustomerAccountService customerAccountService, IOrderRepository orderRepository, IMappingEngine mapper)
 {
     this.userEmail = userEmail;
     this.customerAccountService = customerAccountService;
     this.orderRepository = orderRepository;
     this.mapper = mapper;
 }
开发者ID:mamluka,项目名称:JewelryONet,代码行数:7,代码来源:MyAccountViewModelBuilder.cs

示例3: EmailRingEmailTemplateViewModelBuilder

 public EmailRingEmailTemplateViewModelBuilder(EmailRingModel model, IJewelRepository jewelRepository,
     IMappingEngine mapper)
 {
     this.model = model;
     this.jewelRepository = jewelRepository;
     this.mapper = mapper;
 }
开发者ID:mamluka,项目名称:JewelryONet,代码行数:7,代码来源:EmailRingEmailTemplateViewModelBuilder.cs

示例4: CompositionsViewModelProvider

 public CompositionsViewModelProvider(
     IImageRepository imageRepository, 
     IMappingEngine mappingEngine)
 {
     _imageRepository = imageRepository;
     _mappingEngine = mappingEngine;
 }
开发者ID:kobyb1988,项目名称:PhotoBox,代码行数:7,代码来源:CompositionsViewModelProvider.cs

示例5: PrinterMessageProvider

 public PrinterMessageProvider(
     QueueListenerFactory listenerFactory,
     IMappingEngine mappingEngine)
 {
     _listenerFactory = listenerFactory;
     _mappingEngine = mappingEngine;
 }
开发者ID:kobyb1988,项目名称:PhotoBox,代码行数:7,代码来源:PrinterMessageProvider.cs

示例6: BorrowerItemController

 public BorrowerItemController(IBorrowerItemRepository borrowerItemRepository, IMappingEngine mappingEngine, IBorrowerRepository borrowerRepository, IItemRepository itemRepository)
 {
     _borrowerItemRepository = borrowerItemRepository;
     _mappingEngine = mappingEngine;
     _borrowerRepository = borrowerRepository;
     _itemRepository = itemRepository;
 }
开发者ID:RyhilaEbrahim,项目名称:LendingLibrary,代码行数:7,代码来源:BorrowerItemController.cs

示例7: Initialize

        public void Initialize()
        {
            _uow = A.Fake<IUnitOfWork>();
            _mapper = A.Fake<IMappingEngine>();
            _service = new HouseService(_uow, _mapper);

            // Initializing HouseDTO's
            _nonExistingHouseDTO = new HouseDTO();
            _existingHouseDTO = new HouseDTO();
            _houseWithBookingsDTO = new HouseDTO();
            _houseWithNoBookingsDTO = new HouseDTO();

            // Initializing Houses
            _nonExistingHouse = new House();
            _existingHouse = new House();
            _houseWithBookings = new House();
            _houseWithNoBookings = new House();

            // Controlling mapper behaviour
            A.CallTo(() => _mapper.Map<House>(_nonExistingHouseDTO)).Returns(_nonExistingHouse);
            A.CallTo(() => _mapper.Map<House>(_existingHouseDTO)).Returns(_existingHouse);
            A.CallTo(() => _mapper.Map<House>(_houseWithBookingsDTO)).Returns(_houseWithBookings);
            A.CallTo(() => _mapper.Map<House>(_houseWithNoBookingsDTO)).Returns(_houseWithNoBookings);

            // Controlling service behaviour
            A.CallTo(() => _uow.HouseRepository.IsDuplicate(_nonExistingHouse)).Returns(false);
            A.CallTo(() => _uow.HouseRepository.IsDuplicate(_existingHouse)).Returns(true);
            A.CallTo(() => _uow.HouseRepository.HasBookings(_houseWithBookings)).Returns(true);
            A.CallTo(() => _uow.HouseRepository.HasBookings(_houseWithNoBookings)).Returns(false);
        }
开发者ID:EmilyWatsonCF,项目名称:ResortManager,代码行数:30,代码来源:HouseServiceTests.cs

示例8: TitleService

 public TitleService(IUnitOfWork unitOfWork, IApplicationUserManager userManager, IMappingEngine mappingEngine)
 {
     _userManager = userManager;
     _unitOfWork = unitOfWork;
     _titles = _unitOfWork.Set<Title>();
     _mappingEngine = mappingEngine;
 }
开发者ID:raminmjj,项目名称:Decision,代码行数:7,代码来源:TitleService.cs

示例9: UserModule

        public UserModule(IMappingEngine mappingEngine, IReadOnlyRepository readOnlyRepository)
        {
            Get["/me"] = r => mappingEngine.Map<User, MeResponse>(this.UserSession().User);

            Get["/user/exists"] =
                r =>
                    {
                        bool exists = false;
                        bool activated = false;
                        var email = (string) Request.Query.email;
                        try
                        {
                            var user =
                                readOnlyRepository.First<User>(x => x.Email == email);
                            exists = true;
                            activated = user.Activated;
                        }
                        catch (ItemNotFoundException<User>)
                        {
                        }
                        return new UserExistenceResponse
                                   {
                                       Exists = exists,
                                       Activated = activated,
                                   };
                    };
        }
开发者ID:kmiloaguilar,项目名称:FireTower,代码行数:27,代码来源:UserModule.cs

示例10: BalanceDateRepository

 public BalanceDateRepository(
                 IModelContextFactory factory, 
                 IMappingEngine mapper)
 {
     this.factory = factory;
     this.mapper = mapper;
 }
开发者ID:harriganjames,项目名称:Finances,代码行数:7,代码来源:BalanceDateRepository.cs

示例11: ModuleManagedViewModel

 public ModuleManagedViewModel(SettingsProvider settingsProvider, IViewModelNavigator navigator,
     IMappingEngine mappingEngine)
 {
     _settingsProvider = settingsProvider;
     _navigator = navigator;
     _mappingEngine = mappingEngine;
 }
开发者ID:kobyb1988,项目名称:PhotoBox,代码行数:7,代码来源:ModuleManagedViewModel.cs

示例12: UserModule

        public UserModule(IMappingEngine mappingEngine, IReadOnlyRepository readOnlyRepository)
        {
            Get["/me"] = r =>
                             {
                                 return mappingEngine.Map<User, MeResponse>(this.UserSession().User);
                             };

            Get["/user/exists"] =
                r =>
                {
                    bool exists = false;
                    bool activated = false;
                    var facebookid = (long)Request.Query.facebookid;
                    try
                    {
                        var user =
                            readOnlyRepository.First<User>(x => x.FacebookId == facebookid);
                        if (user != null)
                        {
                            exists = true;
                            activated = user.Verified;
                        }

                    }
                    catch (ItemNotFoundException<User>)
                    {
                    }
                    return new UserExistenceResponse
                    {
                        Exists = exists,
                        Activated = activated,
                    };
                };
        }
开发者ID:rsiwady29,项目名称:FireTower,代码行数:34,代码来源:UserModule.cs

示例13: ReportModule

        public ReportModule(IReportService reportService, IReportResultService reportResultService, IMappingEngine mappingEngine)
            : base("data/reports", mappingEngine, UserRole.Standard)
        {
            this.reportService = reportService;
            this.reportResultService = reportResultService;

            Get["/"] = SearchReports;

            Get["/{id}"] = GetReport;

            Post["/"] = AddReport;

            Put["/{id}"] = UpdateReport;

            Delete["/{id}"] = DeleteReport;

            Put["/{id}/request"] = RequestReport;

            Get["/myResults"] = GetMyResults;

            Get["/results/{id}"] = ViewReportResults;

            Get["/results/{id}/download/{*}"] = DownloadReportResults;

            Get["/builder"] = GetReportBuilderData;

            Get["/builder/summary"] = GetReportDataSummary;
        }
开发者ID:apxnowhere,项目名称:Encore,代码行数:28,代码来源:ReportModule.cs

示例14: PersonController

 public PersonController(IPersonRepository personRepository, IMappingEngine mappingEngine)
 {
     if (personRepository == null) throw new ArgumentNullException(nameof(personRepository));
     if (mappingEngine == null) throw new ArgumentNullException(nameof(mappingEngine));
     this._personRepository = personRepository;
     this._mappingEngine = mappingEngine;
 }
开发者ID:musa-zulu,项目名称:LendingLibrary,代码行数:7,代码来源:PersonController.cs

示例15: MyAccountModule

        public MyAccountModule(IUserService userService, IMappingEngine mappingEngine)
            : base("data/users", mappingEngine, UserRole.Standard)
        {
            Get["/myAccount"] = args =>
            {
                var authorizedUser = Context.GetAuthorizedUser();

                var foundUser = userService.Get(authorizedUser.Id);
                return MapTo<User>(foundUser);
            };

            Put["/myAccount"] = args =>
            {
                var model = this.BindAndValidate<Models.User>();

                if (!ModelValidationResult.IsValid)
                {
                    return RespondWithValidationFailure(ModelValidationResult);
                }

                var authorizedUser = Context.GetAuthorizedUser();
                var updateEntity = MapTo<SystemUser>(model);
                var updatedUser = userService.UpdateUser(authorizedUser.Id, authorizedUser.Id, updateEntity);

                Context.SetupSession(updatedUser);
                return MapTo<User>(updatedUser);
            };
        }
开发者ID:apxnowhere,项目名称:Encore,代码行数:28,代码来源:MyAccountModule.cs


注:本文中的IMappingEngine类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。