コード例 #1
0
ファイル: StripeService.cs プロジェクト: nkohari/stripe.net
 public StripeService(string apiKey, IMapper mapper, IRequestor requestor, IParameterBuilder parameterBuilder)
 {
     ApiKey = apiKey;
     Mapper = mapper;
     Requestor = requestor;
     ParameterBuilder = parameterBuilder;
 }
コード例 #2
0
 public InvoicesController(IInvoiceService invoiceService, IPatronService patronService, IProductService productService, IMapper<Invoice, InvoiceDTO> mapper)
 {
     _invoiceService = invoiceService;
     _patronService = patronService;
     _productService = productService;
     _mapper = mapper;
 }
コード例 #3
0
        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>();
            });
             */
        }
コード例 #4
0
 public UsersForAdminCsvPublishService(CloudBlobClient blobClient,
     IAdminUserService adminUserService,
     IMapper mapper) : base(blobClient, new UserForAdminCsvFormatter())
 {
     _adminUserService = adminUserService;
     _mapper = mapper;
 }
コード例 #5
0
 public void MyTestInitialize()
 {
     _repositoryStub = MockRepository.GenerateStub<IUsersRepository>();
     _userMapperStub = MockRepository.GenerateStub<IMapper>();
     _sut = new UsersController(_repositoryStub, _userMapperStub);
     InitializeController(_sut);
 }
コード例 #6
0
 public CourseController(ICourseRepository courseRepository, IDepartmentRepository departmentRepository,
     IMapper mapper)
 {
     _courseRepository = courseRepository;
     _departmentRepository = departmentRepository;
     _mapper = mapper;
 }
コード例 #7
0
        public UserCountsRepository(ICassandraSession session, IMapper mapper)
        {
            _session = session;
            _mapper = mapper;

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

            string userIdPropertyName = NameOfHelper.PropertyName<UserCountsEntity>(x => x.UserId);
            string likesPropertyName = NameOfHelper.PropertyName<UserCountsEntity>(x => x.Likes);
            string dislikesPropertyName = NameOfHelper.PropertyName<UserCountsEntity>(x => x.Dislikes);
            string viewsPropertyName = NameOfHelper.PropertyName<UserCountsEntity>(x => x.Views);
            string abusesPropertyName = NameOfHelper.PropertyName<UserCountsEntity>(x => x.Abuses);

            _getStatement = new Lazy<PreparedStatement>(() => _session.Get().Prepare(string.Format("SELECT * FROM \"{0}\" WHERE \"{1}\" = ?", entityName, userIdPropertyName)));
            _incViewsStatement =
                new Lazy<PreparedStatement>(
                    () => _session.Get().Prepare(string.Format("UPDATE  \"{0}\" SET \"{2}\" = \"{2}\" + 1 WHERE \"{1}\" = ?", entityName, userIdPropertyName, viewsPropertyName)));
            _incLikesStatement =
                new Lazy<PreparedStatement>(
                    () => _session.Get().Prepare(string.Format("UPDATE  \"{0}\" SET \"{2}\" = \"{2}\" + 1 WHERE \"{1}\" = ?", entityName, userIdPropertyName, likesPropertyName)));
            _incDislikesStatement =
                new Lazy<PreparedStatement>(
                    () => _session.Get().Prepare(string.Format("UPDATE  \"{0}\" SET \"{2}\" = \"{2}\" + 1 WHERE \"{1}\" = ?", entityName, userIdPropertyName, dislikesPropertyName)));
            _decLikesStatement =
                new Lazy<PreparedStatement>(
                    () => _session.Get().Prepare(string.Format("UPDATE  \"{0}\" SET \"{2}\" = \"{2}\" - 1 WHERE \"{1}\" = ?", entityName, userIdPropertyName, likesPropertyName)));
            _decDislikesStatement =
                new Lazy<PreparedStatement>(
                    () => _session.Get().Prepare(string.Format("UPDATE  \"{0}\" SET \"{2}\" = \"{2}\" - 1 WHERE \"{1}\" = ?", entityName, userIdPropertyName, dislikesPropertyName)));
            _incAbuseStatement =
                new Lazy<PreparedStatement>(
                    () => _session.Get().Prepare(string.Format("UPDATE  \"{0}\" SET \"{2}\" = \"{2}\" + 1 WHERE \"{1}\" = ?", entityName, userIdPropertyName, abusesPropertyName)));
        }
コード例 #8
0
ファイル: LinkMapper.cs プロジェクト: bevacqua/bruttissimo
 public void CreateMaps(IMapper mapper)
 {
     mapper.CreateMap<FacebookPost, Link>().ForMember(
         m => m.ReferenceUri,
         x => x.MapFrom(p => p.Link)
     ).ForMember(
         m => m.Title,
         x => x.MapFrom(p => p.Name)
     ).ForMember(
         m => m.Description,
         x => x.MapFrom(p => p.Description)
     ).ForMember(
         m => m.Picture,
         x => x.MapFrom(p => p.Picture)
     ).ForMember(
         m => m.Type,
         x => x.MapFrom(p => LinkType.Html)
     ).ForMember(
         m => m.Created,
         x => x.MapFrom(p => p.CreatedTime)
     ).Ignoring(
         m => m.Id,
         m => m.PostId
     );
 }
コード例 #9
0
 public AboutController(
     INewsTasks newsTasks,
     IMapper<IList<NewsItem>, AboutPageViewModel> aboutPageViewModelMapper)
 {
     this.newsTasks = newsTasks;
     this.aboutPageViewModelMapper = aboutPageViewModelMapper;
 }
コード例 #10
0
 public ReactivateTaskWorkflowProcessor(ITaskByIdQueryProcessor taskByIdQueryProcessor,
 IUpdateTaskStatusQueryProcessor updateTaskStatusQueryProcessor, IMapper autoMapper)
 {
     _taskByIdQueryProcessor = taskByIdQueryProcessor;
     _updateTaskStatusQueryProcessor = updateTaskStatusQueryProcessor;
     _autoMapper = autoMapper;
 }
コード例 #11
0
    public FileListingController(FileListingViewModel ViewModel, MainMenuViewModel MenuViewModel, IMessenger Messenger, IMapper Mapper, IUpkFileRepository Repository, IUpkFileRemoteRepository RemoteRepository) {
          viewModel = ViewModel;
      menuViewModel = MenuViewModel;

      messenger = Messenger;
         mapper = Mapper;

      repository = Repository;

      remoteRepository = RemoteRepository;

      viewModel.Files = new ObservableCollection<FileViewEntity>();

      viewModel.FilterText = String.Empty;

          viewModel.PropertyChanged += onViewModelPropertyChanged;
      menuViewModel.PropertyChanged += onMenuViewModelPropertyChanged;

      allFiles = new List<DomainUpkFile>();

      allFileEntities = new List<FileViewEntity>();

      registerMessages();
      registerCommands();
    }
コード例 #12
0
ファイル: Routes.cs プロジェクト: mickdelaney/mickdelaney
        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>();
            });
             */
        }
コード例 #13
0
        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)));
        }
コード例 #14
0
 public ThingyController(IGetThingyQuery getThingyQuery, IMapper<ThingyQueryDto, ThingyModel> dtoToModelMapper,
     ISaveThingyCommand saveThingyCommand)
 {
     GetThingyQuery = getThingyQuery;
     DtoToModelMapper = dtoToModelMapper;
     SaveThingyCommand = saveThingyCommand;
 }
コード例 #15
0
 public ProjectScreenshotService(IProjectRepository projectRepository, IMapper mapper, IFileUriProvider uriProvider, IFileSystem fileSystem)
 {
     _projectRepository = projectRepository;
     _uriProvider = uriProvider;
     _fileSystem = fileSystem;
     _mapper = mapper;
 }
コード例 #16
0
        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)));
        }
コード例 #17
0
 public void CreateMaps(IMapper mapper)
 {
     mapper.CreateMap<ScheduledJobDto, ScheduledJobModel>().ForMember(
         m => m.StartTime,
         x => x.MapFrom(j => userService.ToCurrentUserTimeZone(HttpContext.Current.Wrap(), j.StartTime))
     );
 }
コード例 #18
0
        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;
        }
コード例 #19
0
ファイル: JobsController.cs プロジェクト: jhonner72/plat
 public JobsController(
     IExchangePublisher<JobRequest> jobExchangePublisher,
     IMapper<CreateJobFromFileRequest, JobRequest> jobRequestMapper)
 {
     this.jobRequestMapper = jobRequestMapper;
     this.jobExchangePublisher = jobExchangePublisher;
 }
コード例 #20
0
 public InMemoryIdentityManagerService(ICollection<InMemoryScope> scopes, ICollection<InMemoryClient> clients)
 {
     this._clients = clients;
     this._scopes = scopes;
     Config = new MapperConfiguration(cfg => {
         cfg.CreateMap<InMemoryClientClaim, ClientClaimValue>();
         cfg.CreateMap<ClientClaimValue, InMemoryClientClaim>();
         cfg.CreateMap<InMemoryClientSecret, ClientSecretValue>();
         cfg.CreateMap<ClientSecretValue, InMemoryClientSecret>();
         cfg.CreateMap<InMemoryClientIdPRestriction, ClientIdPRestrictionValue>();
         cfg.CreateMap<ClientIdPRestrictionValue, InMemoryClientIdPRestriction>();
         cfg.CreateMap<InMemoryClientPostLogoutRedirectUri, ClientPostLogoutRedirectUriValue>();
         cfg.CreateMap<ClientPostLogoutRedirectUriValue, InMemoryClientPostLogoutRedirectUri>();
         cfg.CreateMap<InMemoryClientRedirectUri, ClientRedirectUriValue>();
         cfg.CreateMap<ClientRedirectUriValue, InMemoryClientRedirectUri>();
         cfg.CreateMap<InMemoryClientCorsOrigin, ClientCorsOriginValue>();
         cfg.CreateMap<ClientCorsOriginValue, InMemoryClientCorsOrigin>();
         cfg.CreateMap<InMemoryClientCustomGrantType, ClientCustomGrantTypeValue>();
         cfg.CreateMap<ClientCustomGrantTypeValue, InMemoryClientCustomGrantType>();
         cfg.CreateMap<InMemoryClientScope, ClientScopeValue>();
         cfg.CreateMap<ClientScopeValue, InMemoryClientScope>();
         cfg.CreateMap<InMemoryScopeClaim, ScopeClaimValue>();
         cfg.CreateMap<ScopeClaimValue, InMemoryScopeClaim>();
         cfg.CreateMap<InMemoryScope, Scope>();
         cfg.CreateMap<Scope, InMemoryScope>();
     });
     Mapper = Config.CreateMapper();
 }
コード例 #21
0
ファイル: PostMapper.cs プロジェクト: bevacqua/bruttissimo
 public void CreateMaps(IMapper mapper)
 {
     mapper.CreateMap<FacebookPost, Post>().ForMember(
         m => m.FacebookPostId,
         x => x.MapFrom(p => p.Id)
     ).ForMember(
         m => m.FacebookFeedId,
         x => x.MapFrom(p => p.To.Data[0].Id)
     ).ForMember(
         m => m.FacebookUserId,
         x => x.MapFrom(p => p.From.Id)
     ).ForMember(
         m => m.UserMessage,
         x => x.MapFrom(p => p.Message)
     ).ForMember(
         m => m.Created,
         x => x.MapFrom(p => p.CreatedTime)
     ).Ignoring(
         m => m.Id,
         m => m.UserId,
         m => m.User,
         m => m.LinkId,
         m => m.Link,
         m => m.Updated,
         m => m.TwitterPostId,
         m => m.TwitterUserId,
         m => m.Comments
     );
 }
コード例 #22
0
ファイル: MessageRepository.cs プロジェクト: ZigGreen/nosql
 public MessageRepository(IMapper<Message, MessageDocument> messageDocumentMapper)
 {
     this.messageDocumentMapper = messageDocumentMapper;
     mappingSource = new AttributeMappingSource();
     connectionString = ConfigurationManager.ConnectionStrings["SqlConnectionString"].ConnectionString;
     context = new AppContext(connectionString);
 }
コード例 #23
0
 public AutoMapViewResult(IMapper mapper, Type sourceType, Type destinationType, ViewResult view)
 {
     Mapper = mapper;
     SourceType = sourceType;
     DestinationType = destinationType;
     View = view;
 }
コード例 #24
0
 public BasicApiProvider_1_4(IMapper mapper, IEventsProvider eventAggregator)
 {
     Helper.GuardNotNull(mapper);
     Helper.GuardNotNull(eventAggregator);
     _mapper = mapper;
     _eventAggregator = eventAggregator;
 }
コード例 #25
0
 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;
 }
コード例 #26
0
 public EventOrchestrator(IMapper mapper, IArtistRepository repository, IFacebookExternalRepository facebookExternalRepository, ILastFmExternalRepository lastFmExternalRepository)
 {
     _mapper = mapper;
     _repository = repository;
     _facebookExternalRepository = facebookExternalRepository;
     _lastFmExternalRepository = lastFmExternalRepository;
 }
コード例 #27
0
 public UserController(
     IIdentityService identityService,
     IMapper<string, string, LoginPageViewModel> loginPageViewModelMapper)
 {
     this.identityService = identityService;
     this.loginPageViewModelMapper = loginPageViewModelMapper;
 }
コード例 #28
0
ファイル: Routes.cs プロジェクト: rexwhitten/reportspace
        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"));
                    });
        }
コード例 #29
0
 public ProjectPartnersController(
     IRepository<Partner> partners,
     IMapper mapper)
 {
     this.Partners = partners;
     this.Mapper = mapper;
 }
コード例 #30
0
        public ProductsController(IGenericRepository<Product> productsRepo, IGenericRepository<ProductBrand> productBrandRepo, IGenericRepository<ProductType> productTypeRepo, IMapper mapper)
        {
            _mapper = mapper;
            _productTypeRepo = productTypeRepo;
            _productBrandRepo = productBrandRepo;
            _productsRepo = productsRepo;

        }
 public CategoriesController(FastFoodContext context, IMapper mapper)
 {
     this.context = context;
     this.mapper = mapper;
 }
コード例 #32
0
 public UserFactory(IMapper mapper, ITimeService timeService)
 {
     _mapper      = mapper;
     _timeService = timeService;
 }
コード例 #33
0
 public IssLocationGetHandler(IMapper mapper, ILocationApiRepository apiRepo, IRepositoryWrapper repository)
 {
     _mapper  = mapper;
     _apiRepo = apiRepo;
 }
コード例 #34
0
 protected BaseController(IMapper mapper, IUnitOfWork unitOfWork) : base()
 {
     Mapper     = mapper;
     UnitOfWork = unitOfWork;
 }
コード例 #35
0
 public GetProvincesQueryHandler(IProvinceRepository repository, IMapper mapper)
 {
     _repository = repository ?? throw new System.ArgumentNullException(nameof(repository));
     _mapper     = mapper ?? throw new System.ArgumentNullException(nameof(mapper));
 }
コード例 #36
0
 public UsersController(IDatingRepository repo, IMapper mapper)
 {
     _mapper = mapper;
     _repo   = repo;
 }
コード例 #37
-39
ファイル: Observation.cs プロジェクト: kgarsuta/iseahorse
        public Observation(dynamic obj, IMapper<Observation> observationMapper)
        {
            Photos = new List<Photo>();
            Feedback = new List<FeedBack>();

            observationMapper.Map(obj, this);
        }