• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IMappingEngine类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: AuditLogService

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


示例17: WithDefaultFakeMapper

        public GenreServiceBuilder WithDefaultFakeMapper()
        {
            var fakeMapping = A.Fake<IMappingEngine>();
            _mapper = fakeMapping;

            return this;
        }
开发者ID:sunilmunikar,项目名称:BestPractices,代码行数:7,代码来源:GenreServiceBuilder.cs


示例18: EntireEvaluationService

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


示例19: Setup

        public void Setup()
        {
            _session = new HappyPathInMemorySession();
            _mappingEngine = Substitute.For<IMappingEngine>();

            _personService = new PersonService(_session, _mappingEngine);
        }
开发者ID:kindohm,项目名称:HappyPath,代码行数:7,代码来源:PersonServiceTests.cs


示例20: AuctionsController

 public AuctionsController(
     IAuctionBlockService auctionBlockService,
     IMappingEngine mappingEngine)
 {
     _auctionBlockService = auctionBlockService;
     _mappingEngine = mappingEngine;
 }
开发者ID:RyanVice,项目名称:AuctionBlock,代码行数:7,代码来源:AuctionsController.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IMappingEngineRunner类代码示例发布时间:2022-05-24
下一篇:
C# IMapping类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap