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

C# IMapper类代码示例

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

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



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

示例1: Map

        public override void Map(IMapper map)
        {
            map.DebugRoute("routedebug");
            map.Root<CommentsController>(c => c.Index(null));
            map.Resources<CommentsController>(c => c.Only("index", "new", "create"));
            map.Resource<ContactController>(c => c.Only("new", "create"));
            map.Resource<ErrorController>(e => e.Only("show"));

            /*
             * Note: You can register and next resources
             *
            map.Root<HomeController>(x => x.Index());

            map.Resources<BlogsController>(blogs =>
            {
                blogs.As("weblogs");
                blogs.Only("index", "show");
                blogs.Collection(x => x.Get("latest"));

                blogs.Resources<PostsController>(posts =>
                {
                    posts.Except("create", "update", "destroy");
                    posts.Resources<CommentsController>(c => c.Except("destroy"));
                });
            });

            map.Area<Controllers.Admin.BlogsController>("admin", admin =>
            {
                admin.Resources<Controllers.Admin.BlogsController>();
                admin.Resources<Controllers.Admin.PostsController>();
            });
             */
        }
开发者ID:khalidabuhakmeh,项目名称:AspNetMvcTalk,代码行数:33,代码来源:Routes.cs


示例2: Map

        public override void Map(IMapper map)
        {
            map.DebugRoute("routedebug");

            map.Root<CategoryController>(c => c.Index("/"));

            map.Resources<UserController>();

            map.Resources<ReportController>(c => c.Member(x => x.Get("Search")));

            map.Resources<ReportParameterController>(reportParameter => reportParameter.Only("Index"));

            map.Resources<CategoryController>(category => category.Only("Index"));

            map.Resources<ClientController>(client => client.Only("Index"));

            map.Resources<RoleController>(r => r.WithFormatRoutes());

            map.Resource<FileController>(file => file.Only("Create"));

            map.Resource<SearchController>(s => s.Only("New", "Create"));

            map.Resources<AccountController>(
                account =>
                    {
                        account.Except("new", "create", "show", "index", "update", "destroy");
                        account.Collection(x => x.Get("Login"));
                        account.Collection(x => x.Post("Login"));
                        account.Collection(x => x.Get("Register"));
                        account.Collection(x => x.Post("Register"));
                        account.Collection(x => x.Put("Confirm"));
                    });
        }
开发者ID:rexwhitten,项目名称:reportspace,代码行数:33,代码来源:Routes.cs


示例3: ProjectPartnersController

 public ProjectPartnersController(
     IRepository<Partner> partners,
     IMapper mapper)
 {
     this.Partners = partners;
     this.Mapper = mapper;
 }
开发者ID:InKolev,项目名称:DiagnoseMe,代码行数:7,代码来源:ProjectPartnersController.cs


示例4: CourseController

 public CourseController(ICourseRepository courseRepository, IDepartmentRepository departmentRepository,
     IMapper mapper)
 {
     _courseRepository = courseRepository;
     _departmentRepository = departmentRepository;
     _mapper = mapper;
 }
开发者ID:AlexKeySmith,项目名称:Specify,代码行数:7,代码来源:CourseController.cs


示例5: PersonController

 public PersonController(IPersonRepository personRepository, IMapper mapper)
 {
     if (personRepository == null) throw new ArgumentNullException(nameof(personRepository));
     if (mapper == null) throw new ArgumentNullException(nameof(mapper));
     _personRepository = personRepository;
     _mapper = mapper;
 }
开发者ID:Marsh87,项目名称:LendingLibrary,代码行数:7,代码来源:PersonController.cs


示例6: UserController

 public UserController(
     IIdentityService identityService,
     IMapper<string, string, LoginPageViewModel> loginPageViewModelMapper)
 {
     this.identityService = identityService;
     this.loginPageViewModelMapper = loginPageViewModelMapper;
 }
开发者ID:jamesbroome,项目名称:Who-Can-Help-Me,代码行数:7,代码来源:UserController.cs


示例7: ProjectScreenshotService

 public ProjectScreenshotService(IProjectRepository projectRepository, IMapper mapper, IFileUriProvider uriProvider, IFileSystem fileSystem)
 {
     _projectRepository = projectRepository;
     _uriProvider = uriProvider;
     _fileSystem = fileSystem;
     _mapper = mapper;
 }
开发者ID:GusLab,项目名称:video-portal,代码行数:7,代码来源:ProjectScreenshotService.cs


示例8: MessageRepository

 public MessageRepository(IMapper<Message, MessageDocument> messageDocumentMapper)
 {
     this.messageDocumentMapper = messageDocumentMapper;
     mappingSource = new AttributeMappingSource();
     connectionString = ConfigurationManager.ConnectionStrings["SqlConnectionString"].ConnectionString;
     context = new AppContext(connectionString);
 }
开发者ID:ZigGreen,项目名称:nosql,代码行数:7,代码来源:MessageRepository.cs


示例9: CreateMaps

 public void CreateMaps(IMapper mapper)
 {
     mapper.CreateMap<ScheduledJobDto, ScheduledJobModel>().ForMember(
         m => m.StartTime,
         x => x.MapFrom(j => userService.ToCurrentUserTimeZone(HttpContext.Current.Wrap(), j.StartTime))
     );
 }
开发者ID:bevacqua,项目名称:bruttissimo,代码行数:7,代码来源:ScheduledJobModelMapper.cs


示例10: ThingyController

 public ThingyController(IGetThingyQuery getThingyQuery, IMapper<ThingyQueryDto, ThingyModel> dtoToModelMapper,
     ISaveThingyCommand saveThingyCommand)
 {
     GetThingyQuery = getThingyQuery;
     DtoToModelMapper = dtoToModelMapper;
     SaveThingyCommand = saveThingyCommand;
 }
开发者ID:jackawatts,项目名称:DotNetAppStarterKit,代码行数:7,代码来源:ThingyController.cs


示例11: AffinityGroupItemCountsRepository

        public AffinityGroupItemCountsRepository(ICassandraSession session, IMapper mapper)
        {
            _session = session;
            _mapper = mapper;

            // Preparing statements
            TableAttribute tableAttribute = typeof (AffinityGroupItemCountsEntity).GetCustomAttributes(typeof (TableAttribute), true).Select(a => (TableAttribute)a).First();
            string entityName = tableAttribute.Name;

            string rowKeyPropertyName = NameOfHelper.PropertyName<AffinityGroupItemCountsEntity>(x => x.AffinityGroupSignalType);
            string itemIdPropertyName = NameOfHelper.PropertyName<AffinityGroupItemCountsEntity>(x => x.ItemId);
            string countPropertyName = NameOfHelper.PropertyName<AffinityGroupItemCountsEntity>(x => x.Count);

            _getByIdStatement =
                new Lazy<PreparedStatement>(() => _session.Get().Prepare(string.Format("SELECT * FROM \"{0}\" WHERE \"{1}\" = ? AND \"{2}\" = ?", entityName, rowKeyPropertyName, itemIdPropertyName)));
            _getStatement =
                new Lazy<PreparedStatement>(
                    () => _session.Get().Prepare(string.Format("SELECT * FROM \"{0}\" WHERE \"{1}\" = ?", entityName, rowKeyPropertyName)));
            _incStatement =
                new Lazy<PreparedStatement>(
                    () =>
                        _session.Get()
                            .Prepare(string.Format("UPDATE  \"{0}\" SET \"{1}\" = \"{1}\" + 1 WHERE \"{2}\" = ? AND \"{3}\" = ?", entityName, countPropertyName, rowKeyPropertyName, itemIdPropertyName)));
            _decStatement =
                new Lazy<PreparedStatement>(
                    () =>
                        _session.Get()
                            .Prepare(string.Format("UPDATE  \"{0}\" SET \"{1}\" = \"{1}\" - 1 WHERE \"{2}\" = ? AND \"{3}\" = ?", entityName, countPropertyName, rowKeyPropertyName, itemIdPropertyName)));
        }
开发者ID:GusLab,项目名称:video-portal,代码行数:29,代码来源:AffinityGroupItemCountsRepository.cs


示例12: StudentController

        public StudentController(IGenericRepository repository, 
            IMapper<Student, ProfileModel> studentToProfileModelMapper,
            IMapper<Student, IndexModel> studentToStudentIndexModelMapper,
            IMapper<NameModel, Student> studentNameToStudentMapper, 
            IMapper<HomeAddressModel, StudentAddress> studentHomeAddressToStudentMapper,
            AzureStorageUploader fileUploader, IStudentRepository studentRepository,
            IMapper<EditableStudentBiographicalInfoModel, Student> studentBiographicalInfoToStudentMapper, 
            IParentRepository parentRepository, 
            IMapper<EditProfileParentModel, Parent> editProfileParentModelToParentMapper,
            ProgramStatusModelToProgramStatusForEditMapper programStatusModelToProgramStatusForEditMapper, 
			EditAcademicDetailModelToStudentAcademicDetailMapper editAcademicDetailModelToStudentAcademicDetailMapper)
        {
            _repository = repository;
            _studentToProfileModelMapper = studentToProfileModelMapper;
            _studentToStudentIndexModelMapper = studentToStudentIndexModelMapper;
            _fileUploader = fileUploader;
            _studentRepository = studentRepository;
            _studentBiographicalInfoToStudentMapper = studentBiographicalInfoToStudentMapper;
            _studentNameToStudentMapper = studentNameToStudentMapper;
            _studentHomeAddressToStudentMapper = studentHomeAddressToStudentMapper;
            _parentRepository = parentRepository;
            _editProfileParentModelToParentMapper = editProfileParentModelToParentMapper;
            _programStatusModelToProgramStatusForEditMapper = programStatusModelToProgramStatusForEditMapper;
            _editAcademicDetailModelToStudentAcademicDetailMapper = editAcademicDetailModelToStudentAcademicDetailMapper;
        }
开发者ID:InnovateEDUNYC,项目名称:NGLV1,代码行数:25,代码来源:StudentController.cs


示例13: JobsController

 public JobsController(
     IExchangePublisher<JobRequest> jobExchangePublisher,
     IMapper<CreateJobFromFileRequest, JobRequest> jobRequestMapper)
 {
     this.jobRequestMapper = jobRequestMapper;
     this.jobExchangePublisher = jobExchangePublisher;
 }
开发者ID:jhonner72,项目名称:plat,代码行数:7,代码来源:JobsController.cs


示例14: AutoMapViewResult

 public AutoMapViewResult(IMapper mapper, Type sourceType, Type destinationType, ViewResult view)
 {
     Mapper = mapper;
     SourceType = sourceType;
     DestinationType = destinationType;
     View = view;
 }
开发者ID:RossWhitehead,项目名称:SandboxCore,代码行数:7,代码来源:AutoMapViewResult.cs


示例15: BasicApiProvider_1_4

 public BasicApiProvider_1_4(IMapper mapper, IEventsProvider eventAggregator)
 {
     Helper.GuardNotNull(mapper);
     Helper.GuardNotNull(eventAggregator);
     _mapper = mapper;
     _eventAggregator = eventAggregator;
 }
开发者ID:percramer,项目名称:pjsip4net,代码行数:7,代码来源:BasicApiProvider_1_4.cs


示例16: Map

        public override void Map(IMapper map)
        {
            map.DebugRoute("routedebug");
            /*
             * TODO: Add your routes here.
             *
            map.Root<HomeController>(x => x.Index());

            map.Resources<BlogsController>(blogs =>
            {
                blogs.As("weblogs");
                blogs.Only("index", "show");
                blogs.Collection(x => x.Get("latest"));

                blogs.Resources<PostsController>(posts =>
                {
                    posts.Except("create", "update", "destroy");
                    posts.Resources<CommentsController>(c => c.Except("destroy"));
                });
            });

            map.Area<Controllers.Admin.BlogsController>("admin", admin =>
            {
                admin.Resources<Controllers.Admin.BlogsController>();
                admin.Resources<Controllers.Admin.PostsController>();
            });
             */
        }
开发者ID:mickdelaney,项目名称:mickdelaney,代码行数:28,代码来源:Routes.cs


示例17: EventOrchestrator

 public EventOrchestrator(IMapper mapper, IArtistRepository repository, IFacebookExternalRepository facebookExternalRepository, ILastFmExternalRepository lastFmExternalRepository)
 {
     _mapper = mapper;
     _repository = repository;
     _facebookExternalRepository = facebookExternalRepository;
     _lastFmExternalRepository = lastFmExternalRepository;
 }
开发者ID:yngvebn,项目名称:ArtistBasePage,代码行数:7,代码来源:EventOrchestrator.cs


示例18: ItemSignalsRepository

        public ItemSignalsRepository(ICassandraSession session, IMapper mapper)
        {
            _session = session;
            _mapper = mapper;

            // Preparing statements
            TableAttribute tableAttribute = typeof (ItemSignalsEntity).GetCustomAttributes(typeof (TableAttribute), true).Select(a => (TableAttribute)a).First();
            string entityName = tableAttribute.Name;

            string rowKeyPropertyName = NameOfHelper.PropertyName<ItemSignalsEntity>(x => x.ItemIdSignalType);
            string isAnticolumnPropertyName = NameOfHelper.PropertyName<ItemSignalsEntity>(x => x.IsAnticolumn);
            string userIdPropertyName = NameOfHelper.PropertyName<ItemSignalsEntity>(x => x.UserId);
            string dateTimePropertyName = NameOfHelper.PropertyName<ItemSignalsEntity>(x => x.DateTime);

            _insertStatement =
                new Lazy<PreparedStatement>(
                    () =>
                        _session.Get()
                            .Prepare(string.Format("INSERT INTO \"{0}\" (\"{1}\",\"{2}\",\"{3}\",\"{4}\") VALUES(?,false,?,?)", entityName, rowKeyPropertyName, isAnticolumnPropertyName,
                                userIdPropertyName,
                                dateTimePropertyName)));
            _getStatement =
                new Lazy<PreparedStatement>(
                    () => _session.Get().Prepare(string.Format("SELECT * FROM \"{0}\" WHERE \"{1}\" = ? AND \"{2}\" = ?", entityName, rowKeyPropertyName, isAnticolumnPropertyName)));
            _deleteStatement =
                new Lazy<PreparedStatement>(
                    () =>
                        _session.Get()
                            .Prepare(string.Format("INSERT INTO \"{0}\" (\"{1}\",\"{2}\",\"{3}\",\"{4}\") VALUES(?,true,?,?)", entityName, rowKeyPropertyName, isAnticolumnPropertyName,
                                userIdPropertyName,
                                dateTimePropertyName)));
        }
开发者ID:GusLab,项目名称:video-portal,代码行数:32,代码来源:ItemSignalsRepository.cs


示例19: StripeService

 public StripeService(string apiKey, IMapper mapper, IRequestor requestor, IParameterBuilder parameterBuilder)
 {
     ApiKey = apiKey;
     Mapper = mapper;
     Requestor = requestor;
     ParameterBuilder = parameterBuilder;
 }
开发者ID:nkohari,项目名称:stripe.net,代码行数:7,代码来源:StripeService.cs


示例20: ReactivateTaskWorkflowProcessor

 public ReactivateTaskWorkflowProcessor(ITaskByIdQueryProcessor taskByIdQueryProcessor,
 IUpdateTaskStatusQueryProcessor updateTaskStatusQueryProcessor, IMapper autoMapper)
 {
     _taskByIdQueryProcessor = taskByIdQueryProcessor;
     _updateTaskStatusQueryProcessor = updateTaskStatusQueryProcessor;
     _autoMapper = autoMapper;
 }
开发者ID:SHassona,项目名称:Personal-Repository,代码行数:7,代码来源:ReactivateTaskWorkflowProcessor.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# IMapperConfiguration类代码示例发布时间:2022-05-24
下一篇:
C# IMapDataSource类代码示例发布时间: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