public TaskListController(ITaskService taskService, IObjectMapper mapper)
        {
            this.taskService = taskService;
            this.mapper = mapper;

            AllTasks = new ObservableCollection<TaskViewModel>();
        }
Exemplo n.º 2
0
 public static object Create(Type type, IObjectMapper mapper, Func<IMapper, object, Type, object> lazyLoader)
 {
     return ProxyGenerator.CreateClassProxy(type, new[]
         {
             typeof (INotifyPropertyChanged),
             typeof (DataBindingFactory.IMarkerInterface)
         }, new LazyValueLoadInterceptor(mapper, lazyLoader), new NotifyPropertyChangedInterceptor(type.FullName));
 }
 public RoutePlannerService(ICarPlanner carPlanner, IRoutePlanner routePlanner, 
     IAddressesRepository addressesRepo, IGoogleMapsEmbedUrlProvider urlProvider, 
     IObjectMapper<RouteInternal, Route> mapper)
 {
     _routePlanner = routePlanner;
     _addressesRepo = addressesRepo;
     _urlProvider = urlProvider;
     _carPlanner = carPlanner;
     _mapper = mapper;
 }
Exemplo n.º 4
0
        public DeploymentModule(IDocumentSession session, IObjectMapper mapper)
            : base("/deployments")
        {
            this._session = session;
            this._mapper = mapper;

            Get ["/{id}"] = OnGet;
            Get ["/"] = OnList;
            Post ["/"] = OnAdd;
        }
Exemplo n.º 5
0
 public ImlOrganizationService(ICommonDataService dataService, IObjectMapper objectMapper)
 {
     DataService   = dataService;
     _objectMapper = objectMapper;
 }
Exemplo n.º 6
0
 public static IMapper GetMapper(this IObjectMapper objectMapper)
 {
     return(objectMapper.AutoObjectMappingProvider.GetMapper());
 }
 public static void OverrideMapper(IObjectMapper mapper)
 {
     Mapper = mapper;
 }
Exemplo n.º 8
0
 public WebSiteSettingAppService(IRepository <SiteSetting> siteSettingRepository, IObjectMapper objectMapper)
 {
     _siteSettingRepository = siteSettingRepository;
     _objectMapper          = objectMapper;
 }
 public SessionAppService(IObjectMapper objectMapper)
 {
     _objectMapper = objectMapper;
 }
Exemplo n.º 10
0
 public ImlMedicineController(IConfiguration configuration, ISearchFilterSettingsService filterSettingsService, ImlMedicineService medicineService, IEntityStateHelper entityStateHelper, IObjectMapper mapper, IImlLicenseService imlLicenseService)
     : base(medicineService.DataService, configuration, filterSettingsService)
 {
     _configuration     = configuration;
     _medicineService   = medicineService;
     _entityStateHelper = entityStateHelper;
     _mapper            = mapper;
     _imlLicenseService = imlLicenseService;
 }
Exemplo n.º 11
0
 public QueryAppServiceAsync(IRepositoryAsync <TEntity, TKey> repositoryAsync, IObjectMapper objectMapper) : base(repositoryAsync, objectMapper)
 {
 }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="item"></param>
 /// <returns></returns>
 public int IndexOf(IObjectMapper item)
 {
     lock (_collection) return _collection.IndexOf(item);
 }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="array"></param>
 /// <param name="arrayIndex"></param>
 public void CopyTo(IObjectMapper[] array, int arrayIndex)
 {
     lock (_collection) _collection.CopyTo(array, arrayIndex);
 }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="item"></param>
 /// <returns></returns>
 public bool Contains(IObjectMapper item)
 {
     lock (_collection) return _collection.Contains(item);
 }
Exemplo n.º 15
0
 public PeopleRepository(IObjectMapper mapper)
 {
     this._mapper = mapper;
 }
Exemplo n.º 16
0
 public SingleResultHandler(IObjectMapper objectMapper)
     : base(objectMapper)
 {
 }
 public TaskListController(ITaskService taskService, IObjectMapper mapper, ISettings settings)
 {
     this.taskService = taskService;
     this.mapper = mapper;
     this.settings = settings;
 }
Exemplo n.º 18
0
 public static object Create(Type type, IObjectMapper mapper, Func<IMapper, object, Type, object> lazyLoader)
 {
     return ProxyGenerator.CreateClassProxy(type, new LazyValueLoadInterceptor(mapper, lazyLoader));
 }
Exemplo n.º 19
0
 protected ArrayResultHandler(IObjectMapper objectMapper)
     : base(objectMapper)
 {
 }
Exemplo n.º 20
0
 public IconController(IRedisCache redisCache, IObjectMapper objectMapper, IUnitWork unitWork, IMemoryCache cache, AuthrizeValidator authrize, ILogger <IconController> logger) : base(redisCache, unitWork, cache, authrize, logger)
 {
     base.ObjectMapper      = objectMapper;
     base.IsCustomValidator = true;
     base.PageName          = "icon";
 }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="index"></param>
 /// <param name="item"></param>
 public void Insert(int index, IObjectMapper item)
 {
     lock (_collection) _collection.Insert(index, item);
 }
Exemplo n.º 22
0
 public UserOrganizationsAppService(IRepository <UserOrganizationUnit, long> userOrganizationUnitRepository, IObjectMapper objectMapper, IRepository <User, long> userRepository)
 {
     _userOrganizationUnitRepository = userOrganizationUnitRepository;
     _objectMapper   = objectMapper;
     _userRepository = userRepository;
 }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="item"></param>
 /// <returns></returns>
 public bool Remove(IObjectMapper item)
 {
     lock (_collection) return _collection.Remove(item);
 }
Exemplo n.º 24
0
        private LambdaExpression GenerateObjectMapperExpression(MapRequest mapRequest, IObjectMapper mapperToUse, MapperConfiguration mapperConfiguration)
        {
            var destinationType = mapRequest.RequestedTypes.DestinationType;

            var        source      = Parameter(mapRequest.RequestedTypes.SourceType, "source");
            var        destination = Parameter(destinationType, "mapperDestination");
            var        context     = Parameter(typeof(ResolutionContext), "context");
            Expression fullExpression;

            if (mapperToUse == null)
            {
                var message = Constant("Missing type map configuration or unsupported mapping.");
                fullExpression = Block(Throw(New(ExceptionConstructor, message, Constant(null, typeof(Exception)), Constant(mapRequest.RequestedTypes))), Default(destinationType));
            }
            else
            {
                var map = mapperToUse.MapExpression(mapperConfiguration, Configuration, null,
                                                    ToType(source, mapRequest.RuntimeTypes.SourceType),
                                                    ToType(destination, mapRequest.RuntimeTypes.DestinationType),
                                                    context);
                var exception = Parameter(typeof(Exception), "ex");
                fullExpression =
                    TryCatch(ToType(map, destinationType),
                             MakeCatchBlock(typeof(Exception), exception, Block(
                                                Throw(New(ExceptionConstructor, Constant("Error mapping types."), exception, Constant(mapRequest.RequestedTypes))),
                                                Default(destination.Type)), null));
            }
            var nullCheckSource = NullCheckSource(Configuration, source, destination, fullExpression);

            return(Lambda(nullCheckSource, source, destination, context));
        }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="item"></param>
 public void Add(IObjectMapper item)
 {
     lock (_collection) _collection.Add(item);
 }
Exemplo n.º 26
0
            private static LambdaExpression GenerateObjectMapperExpression(MapRequest mapRequest, IObjectMapper mapperToUse, MapperConfiguration mapperConfiguration)
            {
                var destinationType = mapRequest.RequestedTypes.DestinationType;

                var source      = Expression.Parameter(mapRequest.RequestedTypes.SourceType, "source");
                var destination = Expression.Parameter(destinationType, "mapperDestination");
                var context     = Expression.Parameter(typeof(ResolutionContext), "context");
                LambdaExpression fullExpression;

                if (mapperToUse == null)
                {
                    var message = Expression.Constant("Missing type map configuration or unsupported mapping.");
                    fullExpression = Expression.Lambda(Expression.Block(Expression.Throw(Expression.New(ExceptionConstructor, message, Expression.Constant(null, typeof(Exception)), Expression.Constant(mapRequest.RequestedTypes))), Expression.Default(destinationType)), source, destination, context);
                }
                else
                {
                    var map = mapperToUse.MapExpression(mapperConfiguration.TypeMapRegistry, mapperConfiguration, null, ExpressionExtensions.ToType(source, mapRequest.RuntimeTypes.SourceType), destination, context);
                    var mapToDestination = Expression.Lambda(ExpressionExtensions.ToType(map, destinationType), source, destination, context);
                    fullExpression = TryCatch(mapToDestination, source, destination, context, mapRequest.RequestedTypes);
                }
                return(fullExpression);
            }
Exemplo n.º 27
0
        private object FillObject(object result, IObjectMapper mapper, IDataReader datareader)
        {
            foreach (IMapper map in mapper.PropertiesMapping)
            {
                if (map is IObjectMapper && (map as IObjectMapper).IsLazy)
                    continue;
                
                if (map is CollectionFullObjectMapper)
                {
                    var collectionFullObjectMapper = (CollectionFullObjectMapper) map;
                    object listInstance = collectionFullObjectMapper.Getter(result);
                    if (listInstance == null)
                    {
                        listInstance = Activator.CreateInstance((map as CollectionFullObjectMapper).PropertyCollectionType);
                        map.Setter(result, listInstance);
                    }
                    var list = (IList) listInstance;
                    object fillObject = ((CollectionFullObjectMapper)map).CreateInstance();
                    FillObject((CollectionFullObjectMapper) map, datareader, fillObject);

                    if (list.Count > 0)
                    {
                        var curMapper = (FullObjectMapper)GetObjectMapper(fillObject.GetType());

                        object lastElement = list[list.Count - 1];

                        bool allPksEqual = true;

                        //This is needed, because DBValue can be Null, but the Field can be Guid, wich then is filled with Guid.Empty and this is also a valid value!
                        /*foreach (var pkIndex in pkIndexes)
                        {
                            var dbValue = reader.GetValue(pkIndex);
                            if (dbValue == DBNull.Value)
                            {
                                pkIsNull = true;
                                break;
                            }
                        }*/

                        foreach (var pkGetter in curMapper.PrimaryKeyValueGetters)
                        {
                            object lastPk = pkGetter.Invoke(lastElement);
                            object currentPk = pkGetter.Invoke(fillObject);

                            if (!lastPk.Equals(currentPk))
                            {
                                allPksEqual = false;
                                break;
                            }
                        }

                        if (allPksEqual)
                            continue;
                    }

                    ((IList) listInstance).Add(fillObject);
                }
            }

            return result;
        }
Exemplo n.º 28
0
        private void FillObject(IObjectMapper mapper, IDataReader datareader, object result)
        {
            foreach (IMapper map in mapper.PropertiesMapping)
            {
                if (map is IObjectMapper && (map as IObjectMapper).IsLazy)
                    continue;

                if  (map is ValueMapper)
                {
                    if (((ValueMapper)map).SetDataReaderIndex(_schemaColumns))
                        continue;
                }

                if (datareader.IsDBNull(map.DataReaderIndex))
                    continue;

                if (map is ValueMapper)
                {
                    object value = datareader.GetValue(map.DataReaderIndex);

                    try
                    {
                        map.Setter(result, value);
                    }
                    catch (Exception exception)
                    {
                        throw new Exception(
                            string.Format("FillOject failed for field : {0} of class: {1}.\nColumn name : {2} Db type is: {3} and value : {4}",
                                          map.PropertyName, mapper.PropertyType,
                                          ((ValueMapper) map).ColumnName,
                                          value == null ? "Null" : value.GetType().ToString(), value), exception);
                    }
                }

                if (map is FullObjectMapper)
                {
                    object fillObject = ((FullObjectMapper) map).CreateInstance();
                    FillObject((FullObjectMapper) map, datareader, fillObject);
                    map.Setter(result, fillObject);
                }

                if (map is CollectionFullObjectMapper)
                {
                    var collectionFullObjectMapper = (CollectionFullObjectMapper) map;

                    object listInstance = collectionFullObjectMapper.Getter(result);
                    if (listInstance == null)
                    {
                        listInstance = Activator.CreateInstance((map as CollectionFullObjectMapper).PropertyCollectionType);
                        map.Setter(result, listInstance);
                    }

                    object fillObject = ((CollectionFullObjectMapper)map).CreateInstance();
                    FillObject((CollectionFullObjectMapper) map, datareader, fillObject);
                    ((IList) listInstance).Add(fillObject);
                }
            }
        }
Exemplo n.º 29
0
 public WidgetAppService(IRepository <Widget, Guid> widgetRepository, IRepository <Page, Guid> pageRepository, IObjectMapper objectMapper)
 {
     _widgetRepository = widgetRepository;
     _pageRepository   = pageRepository;
     _objectMapper     = objectMapper;
 }
Exemplo n.º 30
0
 /// <summary>
 /// Danner basisklasse for en CommandHandler til finansstyring.
 /// </summary>
 /// <param name="finansstyringRepository">Implementering af repository til finansstyring.</param>
 /// <param name="objectMapper">Implementering af objectmapper.</param>
 /// <param name="exceptionBuilder">Implementering af builderen, der kan bygge exceptions.</param>
 protected FinansstyringCommandHandlerBase(IFinansstyringRepository finansstyringRepository, IObjectMapper objectMapper, IExceptionBuilder exceptionBuilder)
 {
     if (finansstyringRepository == null)
     {
         throw new ArgumentNullException("finansstyringRepository");
     }
     if (objectMapper == null)
     {
         throw new ArgumentNullException("objectMapper");
     }
     if (exceptionBuilder == null)
     {
         throw new ArgumentNullException("exceptionBuilder");
     }
     _finansstyringRepository = finansstyringRepository;
     _objectMapper            = objectMapper;
     _exceptionBuilder        = exceptionBuilder;
 }
Exemplo n.º 31
0
 public DatabaseWorkflowInstanceStore(IWorkflowInstanceRepository workflowInstanceRepository, IObjectMapper <WorkFlowManagementDomainModule> objectMapper, IActivityDefinitionRepository activityDefinitionRepository, IActivityInstanceRepository activityInstanceRepository, IUnitOfWorkManager unitOfWorkManager, IGuidGenerator guidGenerator)
 {
     this._workflowInstanceRepository = workflowInstanceRepository;
     _objectMapper = objectMapper;
     _activityDefinitionRepository = activityDefinitionRepository;
     _activityInstanceRepository   = activityInstanceRepository;
     _unitOfWorkManager            = unitOfWorkManager;
     _guidGenerator = guidGenerator;
 }
Exemplo n.º 32
0
 public StudentAppService(IRepository <Student> studentRepository, IObjectMapper objectMapper)
 {
     _studentRepository = studentRepository;
     _objectMapper      = objectMapper;
 }
Exemplo n.º 33
0
 internal static void SetObjectMapper(IObjectMapper objectMapper)
 {
     _objectMapper = objectMapper;
 }
Exemplo n.º 34
0
 public MarketsController(IRepository <Market> marketRepository, IMarketAppService marketAppService, IObjectMapper objectMapper)
 {
     _marketRepository = marketRepository;
     _marketAppService = marketAppService;
     _objectMapper     = objectMapper;
 }
Exemplo n.º 35
0
 public LazyValueLoadInterceptor(IObjectMapper mapper, Func<IMapper, object, Type, object> lazyLoader)
 {
     _mapper = mapper;
     _lazyLoader = lazyLoader;
 }
 /// <summary>
 /// Danner QueryHandler til håndtering af forespørgelsen: KalenderbrugerAftalerGetQuery.
 /// </summary>
 /// <param name="kalenderRepository">Implementering af repository til kalenderdelen under OSWEBDB.</param>
 /// <param name="fællesRepository">Implementering af repository til fælles elementer i domænet, såsom systemer under OSWEBDB.</param>
 /// <param name="objectMapper">Implementering af objectmapper.</param>
 public KalenderbrugerAftalerGetQueryHandler(IKalenderRepository kalenderRepository, IFællesRepository fællesRepository, IObjectMapper objectMapper)
     : base(kalenderRepository, fællesRepository, objectMapper)
 {
 }
Exemplo n.º 37
0
 /// <summary>
 /// Constructor.
 /// </summary>
 protected AbpServiceBase()
 {
     Logger = NullLogger.Instance;
     ObjectMapper = NullObjectMapper.Instance;
     LocalizationManager = NullLocalizationManager.Instance;
 }
Exemplo n.º 38
0
        protected void BuildSelectSql(IObjectMapper mapper, StringBuilder sb, DbManager db, string tableName = "T")
        {
            int tableNr = 0;

            foreach (IMapper mapField in mapper.PropertiesMapping)
            {
                if (mapField is ValueMapper)
                    sb.AppendFormat("\t{0}.{1} {2},\n"
                                    , tableName /* (mapper).PropertyType.Name */,
                                    db.DataProvider.Convert(((ValueMapper) mapField).ColumnName, ConvertType.NameToQueryField),
                                    ((ValueMapper) mapField).ColumnAlias
                        );
                else if (mapField is IPropertiesMapping)
                {
                    var propertiesMapping = (IPropertiesMapping) mapField;
                    var cel = propertiesMapping.ParentMapping;
                    while (cel != null)
                    {
                        // To avoid recursion dont take in account types already loaded.
                        if (((IMapper) cel).PropertyType == mapField.PropertyType)
                            continue;
                        cel = cel.ParentMapping;
                    }
                    var objectMapper = (IObjectMapper) mapField;
                    if (!objectMapper.IsLazy) 
                        BuildSelectSql(objectMapper, sb, db, tableName + tableNr.ToString());

                    tableNr++;
                }
                else
                    throw new NotImplementedException(mapField.GetType() + " is not yet implemented.");
            }
        }
Exemplo n.º 39
0
 protected ResultHandlerBase(IObjectMapper objectMapper)
     : this()
 {
     this.ObjectMapper = objectMapper;
 }
Exemplo n.º 40
0
 public AssingPaymentDetailCommandHandler(IUnitOfWorkAsync unitOfWorkAsync
                                          , IRepositoryAsync <PaymentTransactionState, Guid> aggregateRootRepository
                                          , IObjectMapper objectMapper) : base(unitOfWorkAsync, aggregateRootRepository, objectMapper)
 {
 }
 public ObjectsBusinessWorkflow(IObjectsRepository objectsRepository, IObjectMapper objectMapper)
 {
     ObjectsRepository = objectsRepository;
     ObjectMapper = objectMapper;
 }
Exemplo n.º 42
0
 public WhseGrpcServer(IProductAppService productAppService
                       , IObjectMapper mapper)
 {
     _productAppService = productAppService;
     _mapper            = mapper;
 }
Exemplo n.º 43
0
        private IMapper GetObjectMapper(IObjectMapper mapper, ref int startIndex, TypeAccessor akTypeAccessor)
        {
            //Todo: Remove this Call!
            _extension = TypeExtension.GetTypeExtension(mapper.PropertyType /*_typeAccessor.OriginalType*/, MappingSchema.Extensions);

            Type mapperType = mapper.PropertyType;
            var objectMappers = new List<IObjectMapper>();

            TableDescription tableDescription = GetTableDescription(mapperType);

            lock (SetterHandlersLock)
            {
                if (!SettersHandlers.ContainsKey(mapperType))
                    SettersHandlers.Add(mapperType, new Dictionary<string, SetHandler>());

                if (!GettersHandlers.ContainsKey(mapperType))
                    GettersHandlers.Add(mapperType, new Dictionary<string, GetHandler>());
            }

            PropertyInfo[] properties = mapperType.GetProperties();

            MemberAccessor primaryKeyMemberAccessor = null;
            foreach (MemberAccessor ma in akTypeAccessor)
            {
                //  Setters
                lock (SetterHandlersLock)
                {
                    if (!SettersHandlers[mapper.PropertyType].ContainsKey(ma.Name))
                    {
                        SettersHandlers[mapper.PropertyType].Add(ma.Name, ma.SetValue);
                    }
                }

                if (GetPrimaryKey(ma) != null)
                {
                    primaryKeyMemberAccessor = ma;

                    lock (SetterHandlersLock)
                    {
                        if (!GettersHandlers[mapperType].ContainsKey(ma.Name))
                        {
                            GettersHandlers[mapperType].Add(ma.Name, ma.GetValue);
                        }
                    }
                    mapper.PrimaryKeyValueGetters.Add(GettersHandlers[mapperType][ma.Name]);
                    mapper.PrimaryKeyNames.Add(ma.Name);

                    if (mapper.Association != null && (mapper.Association.OtherKey == null || mapper.Association.OtherKey.Length == 0))
                    {
                        mapper.Association.OtherKey = new[] {ma.Name};
                    }
                }
            }
            if (primaryKeyMemberAccessor == null)
                throw new Exception("PrimaryKey attribute not found on type: " + mapperType);

            foreach (PropertyInfo prop in properties)
            {
                var ma = akTypeAccessor.First(x => x.Name == prop.Name);

                // Check if the accessor is an association
                var association = GetAssociation(ma);
                if (association != null)
                {
                    //  Getters for IObjectMapper
                    lock (SetterHandlersLock)
                        if (!GettersHandlers[mapperType].ContainsKey(prop.Name))
                        {
                            GettersHandlers[mapperType].Add(prop.Name, ma.GetValue);
                        }

                    bool isCollection = prop.PropertyType.GetInterfaces().ToList().Contains(typeof (IList));
                    IObjectMapper propertiesMapping;
                    if (!isCollection)
                    {
                        // TODO Generate this instance using the CreateObjectMapperInstance method of fullMappingSchema
                        // _db.MappingSchema.CreateObjectMapperInstance(prop.PropertyType)

                        propertiesMapping = new FullObjectMapper(_db, _ignoreLazyLoad, _factoryType)
                            {
                                PropertyType = prop.PropertyType,
                                IsNullable = association.CanBeNull,
                                Getter = GettersHandlers[mapperType][prop.Name],
                            };
                    }
                    else
                    {
                        Type listElementType = GetGenericType(prop.PropertyType);
                        TableDescription colElementTableDescription = GetTableDescription(listElementType);

                        // TODO Generate this instance using the CreateObjectMapperInstance method of fullMappingSchema
                        propertiesMapping = new CollectionFullObjectMapper(_db, _factoryType)
                            {
                                PropertyType = listElementType,
                                Getter = GettersHandlers[mapperType][prop.Name],
                                TableName = colElementTableDescription.TableName,
                                PropertyCollectionType = prop.PropertyType,
                            };

                        if (mapper is FullObjectMapper)
                            ((FullObjectMapper) mapper).ColParent = true;
                    }

                    if (association.ThisKey == null || association.ThisKey.Length == 0)
                        association.ThisKey = new[] {primaryKeyMemberAccessor.Name};

                    bool isLazy = false;
                    if (!_ignoreLazyLoad)
                    {
                        var lazy = GetLazyInstance(ma); // prop.GetCustomAttributes(typeof(LazyInstanceAttribute), true);
                        if (lazy)
                        {
                            isLazy = true;
                            mapper.ContainsLazyChild = true;

                            //  Getters
                            lock (SetterHandlersLock)
                                if (!GettersHandlers[mapperType].ContainsKey(primaryKeyMemberAccessor.Name))
                                {
                                    GettersHandlers[mapperType].Add(primaryKeyMemberAccessor.Name, primaryKeyMemberAccessor.GetValue);
                                }
                        }
                    }

                    propertiesMapping.Association = association;
                    propertiesMapping.PropertyName = prop.Name;
                    propertiesMapping.IsLazy = isLazy;
                    propertiesMapping.Setter = SettersHandlers[mapperType][prop.Name];

                    if (propertiesMapping.IsLazy)
                    {
                        propertiesMapping.ParentKeyGetter = GettersHandlers[mapperType][primaryKeyMemberAccessor.Name];
                    }
                    objectMappers.Add(propertiesMapping);
                }
                else
                {
                    var mapIgnore = GetMapIgnore(ma);
                    if (mapIgnore)
                        continue;

                    var mapField = GetMapField(ma);
                    string columnName = mapField != null ? mapField.MapName : prop.Name;

                    var map = new ValueMapper
                        {
                            PropertyName = prop.Name,
                            PropertyType = prop.PropertyType,
                            DataReaderIndex = startIndex,
                            Setter = SettersHandlers[mapperType][prop.Name],
                            TableName = tableDescription.TableName,
                            ColumnName = columnName,
                        };

                    var mapColumnName = map.GetColumnName(columnName);
                    map.ColumnAlias = columnName == mapColumnName ? null : mapColumnName;

                    mapper.PropertiesMapping.Add(map);

                    var pkField = GetPrimaryKey(ma);
                    if (pkField != null)
                        mapper.DataReaderIndex = startIndex;

                    startIndex++;
                }
            }

            foreach (IObjectMapper objMap in objectMappers)
            {
                #region Check mapping recursion

                IObjectMapper cel = mapper;
                while (cel != null)
                {
                    if (mapper.PropertyType == objMap.PropertyType)
                        continue;

                    cel = (IObjectMapper) cel.ParentMapping;
                }

                #endregion

                objMap.ParentMapping = mapper;
                mapper.PropertiesMapping.Add(GetObjectMapper(objMap, ref startIndex, MappingSchema.GetObjectMapper(objMap.PropertyType).TypeAccessor));
            }

            return mapper;
        }
 public TeacherController(ITeacherService repository, IObjectMapper objectMapper, IFormBuilder builder,
                          IUserGrpcService userGrpcService) : base(
         repository, objectMapper, builder)
 {
     _userGrpcService = userGrpcService;
 }
Exemplo n.º 45
0
 public PeopleController(IPeopleService service, IObjectMapper mapper)
 {
     this._service = service;
     this._mapper = mapper;
 }
Exemplo n.º 46
0
 public SitePageAppService(IRepository <Page, Guid> pageRepository, IRepository <Menu, Guid> menuRepository, IObjectMapper objectMapper, IRepository <Widget, Guid> widgetRepository)
 {
     _pageRepository   = pageRepository;
     _menuRepository   = menuRepository;
     _objectMapper     = objectMapper;
     _widgetRepository = widgetRepository;
 }
 public TaskListController(ITaskService taskService, IObjectMapper mapper)
 {
     this.taskService = taskService;
     this.mapper = mapper;
 }
Exemplo n.º 48
0
 public CrudAppServiceAsync(IRepositoryAsync <TEntity, TKey> repositoryAsync
                            , IObjectMapper objectMapper
                            , IUnitOfWorkAsync unitOfWork) : base(repositoryAsync, objectMapper, unitOfWork)
 {
 }
Exemplo n.º 49
0
 public PlanController(IPlanRepository repo, IObjectMapper mapper)
 {
     mRepo = repo;
       mMapper = mapper;
 }
Exemplo n.º 50
0
 public ValidationContext(TypePair types, PropertyMap propertyMap, IObjectMapper objectMapper) : this(types, propertyMap, objectMapper, null)
 {
 }
Exemplo n.º 51
0
 public CourseController(ICourseService repository, IObjectMapper objectMapper, IFormBuilder builder,
                         IMediator mediator) : base(
         repository, objectMapper, builder)
 {
     _mediator = mediator;
 }
Exemplo n.º 52
0
 public MapperFuncs(MapRequest mapRequest, IObjectMapper mapperToUse, MapperConfiguration mapperConfiguration) : this(mapRequest, GenerateObjectMapperExpression(mapRequest, mapperToUse, mapperConfiguration))
 {
 }
Exemplo n.º 53
0
 ///<inheritdoc/>
 public void Initialize(string repositoriesDirectory, IRepositoryManager repositoryManager, IObjectMapper mapper, Type implementedInterface, RepositoryConfigurations config = null)
 {
     base.Initialize(repositoryManager, mapper, implementedInterface, config);
     _repositoriesDirectory = repositoriesDirectory;
     _jsonSerializer        = JsonSerializer.Create();
     CreateDataFiles();
 }
Exemplo n.º 54
0
 public SignalRChatCommunicator(IObjectMapper objectMapper)
 {
     _objectMapper = objectMapper;
     Logger        = NullLogger.Instance;
 }
Exemplo n.º 55
0
 /// <summary>
 /// Register any required additional mapping information
 /// </summary>
 /// <param name="mapper"></param>
 public virtual void RegisterMappings(IObjectMapper mapper)
 {
 }
Exemplo n.º 56
0
 public MenuAppService(IRepository <Menu, Guid> repository, IObjectMapper mapper) : base(repository)
 {
     _repository = repository;
     _mapper     = mapper;
 }
Exemplo n.º 57
0
        private void AssertConvertMap <TSource, TTarget>(TSource input, TTarget output, IObjectMapper mapper)
        {
            var foo = new GenericFoo <TSource>()
            {
                Prop = input
            };
            var bar = mapper.Map <GenericBar <TTarget> >(foo);

            Assert.AreEqual(output, bar.Prop);
        }
Exemplo n.º 58
0
 public PaginateResultHandler(IObjectMapper objectMapper)
     : base(objectMapper)
 {
 }
Exemplo n.º 59
0
 public PeopleService(IPeopleRepository repository,IObjectMapper mapper)
 {
     this._repository = repository;
     this._mapper = mapper;
 }