Example #1
0
 public GeoDatabaseContext(IHostingEnvironment hostingEnvironment, ICommonMapper mapper,
                           IHostingEnvironment environment, ILogger <GeoDatabaseContext> logger)
 {
     _logger      = logger;
     _environment = environment;
     _mapper      = mapper;
 }
Example #2
0
 public CommonMapperActionResult(ICommonMapper iCommonMapper, Type sourceType, Type destType, ViewResult view)
 {
     _iCommonMapper = iCommonMapper;
     _sourceType    = sourceType;
     _destType      = destType;
     View           = view;
 }
Example #3
0
        public override void OnActionExecuted(ActionExecutedContext filterContext)
        {
            ICommonMapper mappingEngine = DependencyResolver.Current.GetService <ICommonMapper>() ?? GetDefaultMapperFor(SourceType, DestType);
            var           filter        = new CommonMapperActionFilter(mappingEngine, _sourceType, _destType);

            filter.OnActionExecuted(filterContext);
        }
Example #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LanguageResourceService" /> class.
 /// </summary>
 /// <param name="defaultResourceCulture">The default resource culture.</param>
 protected LanguageResourceService(string defaultResourceCulture, ICommonMapper iCommonMapper)
 {
     DefaultResourceCulture = defaultResourceCulture;
     _iCommonMapper         = iCommonMapper;
     //_repository = new LanguageResourceRepository();
     //DefaultResourceCulture = "en-US";
 }
Example #5
0
 public ProjectService(IDataContextFactory dataContextFactory, IEmployeeService employeeService, ICommonMapper commonMapper)
 {
     _context                = dataContextFactory.Create(ConnectionType.Ip);
     _employeeService        = employeeService;
     _commonMapper           = commonMapper;
     _utilityCommonDbContext = _commonMapper.GetCommonDataBAseContext();
 }
Example #6
0
 public SalesController(ISaleRepository orderRepository, IRegionRepository regionRepository,
                        ICountryRepository countryRepository, IItemTypeRepository itemTypeRepository, ICommonMapper mapper,
                        ILogger <SalesController> logger)
 {
     saleRepository          = orderRepository;
     this.regionRepository   = regionRepository;
     this.countryRepository  = countryRepository;
     this.itemTypeRepository = itemTypeRepository;
     Mapper      = mapper;
     this.logger = logger;
 }
Example #7
0
        public void Initialize()
        {
            var settings = new List <CommonMapperProfileResolutionSettings>
            {
                new CommonMapperProfileResolutionSettings
                {
                    AssemblyName = Assembly.GetAssembly(typeof(ANDP.Provisioning.API.Rest.Models.ApMax.ServiceVersions)).GetName().Name,
                    Namespace    = null
                }
            };

            _commonMapper = new CommonMapper(settings);
        }
Example #8
0
        public void Initialize()
        {
            var settings = new List <CommonMapperProfileResolutionSettings>
            {
                new CommonMapperProfileResolutionSettings
                {
                    AssemblyName = Assembly.GetAssembly(typeof(ChannelLineupType)).GetName().Name,
                    Namespace    = null
                }
            };

            _commonMapper = new CommonMapper(settings);
        }
Example #9
0
        public static object CreateInstanceAndMapAndValidate(ICommonMapper mapper, Type sourceType, Type destinationType, object source)
        {
            //Complete mapping
            var        result     = mapper.Map(source, sourceType, destinationType);
            MethodInfo methodInfo = destinationType.GetMethod("Validate");

            //add validation logic here.
            if (methodInfo != null)
            {
                object isValid = methodInfo.Invoke(result, null);
            }

            return(result);
        }
Example #10
0
        public void OrderProfileFixture()
        {
            var settings = new List <CommonMapperProfileResolutionSettings>
            {
                new CommonMapperProfileResolutionSettings
                {
                    AssemblyName = Assembly.GetAssembly(typeof(OrderProfile)).GetName().Name,
                    Namespace    = new List <string> {
                        typeof(OrderProfile).Namespace
                    }
                }
            };

            _commonMapper = new CommonMapper(settings);
        }
Example #11
0
        public void TestInitialize()
        {
            var settings = new List <CommonMapperProfileResolutionSettings>
            {
                new CommonMapperProfileResolutionSettings
                {
                    AssemblyName = Assembly.GetAssembly(typeof(OrderProfile)).GetName().Name,
                    Namespace    = new List <string> {
                        typeof(OrderProfile).Namespace
                    }
                }
            };

            _commonMapper = new CommonMapper(settings);

            _iAndOrderEntities = new ANDP_Order_Entities(BootStrapper.AndpEntitiesBootstrapper().ToString(), "test");
            _iOrderRepository  = new OrderRepository(_iAndOrderEntities);
        }
 public TechnologyController(ISkillSetService skillSetService, ICommonMapper commonMapper)
 {
     _skillSetService = skillSetService;
     _commonMapper    = commonMapper;
 }
Example #13
0
 public EmployeeService(ICommonMapper commonMapper)
 {
     _commonMapper = commonMapper;
 }
Example #14
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LanguageResourceService" /> class.
 /// </summary>
 /// <param name="repository">The repository.</param>
 /// <param name="iCommonMapper">The i common mapper.</param>
 /// <param name="defaultResourceCulture">The default resource culture.</param>
 public LanguageResourceService(ILanguageResourceRepository repository, ICommonMapper iCommonMapper, string defaultResourceCulture)
 {
     _iLanguageResourceRepository = repository;
     DefaultResourceCulture       = defaultResourceCulture;
     _iCommonMapper = iCommonMapper;
 }
Example #15
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LanguageResourceService" /> class.
 /// </summary>
 /// <param name="repository">The repository.</param>
 /// <param name="iCommonMapper">The i common mapper.</param>
 public LanguageResourceService(ILanguageResourceRepository repository, ICommonMapper iCommonMapper)
 {
     _iLanguageResourceRepository = repository;
     _iCommonMapper         = iCommonMapper;
     DefaultResourceCulture = "en-US";
 }
 public StatisticController(ISaleRepository saleRepository, ICommonMapper mapper)
 {
     this.saleRepository = saleRepository;
     this.mapper         = mapper;
 }
 public ItemTypesController(IItemTypeRepository itemTypeRepository, ICommonMapper mapper)
 {
     this.itemTypeRepository = itemTypeRepository;
     Mapper = mapper;
 }
Example #18
0
 public RolesService(ICommonMapper commonMapper)
 {
     _mapper = commonMapper;
 }
Example #19
0
 public CountriesController(ICountryRepository countryRepository, ICommonMapper mapper)
 {
     this.countryRepository = countryRepository;
     this.mapper            = mapper;
 }
Example #20
0
 public InstructorsController(IInstructorRepository instructorRepository, ICommonMapper mapper)
 {
     InstructorRepository = instructorRepository;
     Mapper = mapper;
 }
Example #21
0
 public static object CreateInstanceAndMap(ICommonMapper mapper, Type sourceType, Type destinationType, object source)
 {
     //Complete mapping
     return(mapper.Map(source, sourceType, destinationType));
 }
Example #22
0
 public EquipmentService(IEquipmentRepository equipmentRepository, ICommonMapper iCommonMapper)
 {
     _equipmentRepository = equipmentRepository;
     _iCommonMapper       = iCommonMapper;
 }
Example #23
0
 public CommonMapperActionFilter(ICommonMapper iCommonMapper, Type sourceType, Type destType)
 {
     _iCommonMapper = iCommonMapper;
     _sourceType    = sourceType;
     _destType      = destType;
 }
Example #24
0
 public AuditService(IAuditRepository auditRepository, ICommonMapper commonMapper)
 {
     _iAuditRepository = auditRepository;
     _iCommonMapper    = commonMapper;
 }
Example #25
0
 public static TDestination CreateInstanceAndMap <TSource, TDestination>(ICommonMapper mapper, TSource source)
 {
     //Complete mapping
     return(mapper.Map <TSource, TDestination>(source));
 }
Example #26
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ApMaxController" /> class.
 /// </summary>
 /// <param name="logger">The logger.</param>
 /// <param name="commonMapper">The mapper.</param>
 /// <param name="oauth2AuthenticationSettings">The oauth2 authentication settings.</param>
 public CalixController(ILogger logger, ICommonMapper commonMapper, Oauth2AuthenticationSettings oauth2AuthenticationSettings)
 {
     _commonMapper = commonMapper;
     _logger       = logger;
     _oauth2AuthenticationSettings = oauth2AuthenticationSettings;
 }
Example #27
0
        public static TDestination CreateInstanceAndMapAndValidate <TSource, TDestination>(ICommonMapper mapper, TSource source)
        {
            //Complete mapping
            TDestination result = mapper.Map <TSource, TDestination>(source);

            Type       destinationType = result.GetType();
            MethodInfo methodInfo      = destinationType.GetMethod("Validate");

            //add validation logic here.
            if (methodInfo != null)
            {
                object isValid = methodInfo.Invoke(result, null);
            }

            return(result);
        }
Example #28
0
        //private readonly ICommonDataBaseContext _commonDBContxt;

        //public SkillSetService(IDataContextFactory dataContextFactory)
        //{
        //    _context = dataContextFactory.Create(ConnectionType.Ip);
        //}

        public SkillSetService(ICommonMapper commonMapper)
        {
            _commonMapper    = commonMapper;
            _commonDBContext = commonMapper.GetCommonDataBAseContext();
        }
Example #29
0
 public OrderService(IOrderRepository iOrderRepository, IEquipmentRepository equipmentRepository, ICommonMapper iCommonMapper)
 {
     _iOrderRepository    = iOrderRepository;
     _equipmentRepository = equipmentRepository;
     _iCommonMapper       = iCommonMapper;
 }
Example #30
0
 public EngineService(IEngineRepository iEngineRepository, ICommonMapper iCommonMapper)
 {
     _iEngineRepository = iEngineRepository;
     _iCommonMapper     = iCommonMapper;
 }