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


C# IMapper类代码示例

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


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


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