Ejemplo n.º 1
0
 public PassApiController(
     IActionHandlerOverlord actionHandlerOverlord,
     IRepository <Pass> repository,
     IEntitySearch <Pass> entitySearch)
     : base(actionHandlerOverlord, repository, entitySearch)
 {
 }
Ejemplo n.º 2
0
 public RegistrationApiController(
     IActionHandlerOverlord actionHandlerOverlord,
     IRepository <Registration> repository,
     IEntitySearch <Registration> entitySearch)
     : base(actionHandlerOverlord, repository, entitySearch)
 {
 }
 public AnnouncementApiController(
     IActionHandlerOverlord actionHandlerOverlord,
     IRepository <Announcement> repository,
     IEntitySearch <Announcement> entitySearch)
     : base(actionHandlerOverlord, repository, entitySearch)
 {
 }
Ejemplo n.º 4
0
 public RoomsApiController(
     IActionHandlerOverlord actionHandlerOverlord,
     IRepository <Room> repository,
     IEntitySearch <Room> entitySearch)
     : base(actionHandlerOverlord, repository, entitySearch)
 {
 }
        private static IWhere CreateCarWhereClause(IEntitySearch <Car> search)
        {
            switch (search)
            {
            case CarMakeIDSearch s:
                var carMake = new CarMakeIDWhere(s);
                return(carMake);

            case CarEngineSearch s:
                var carEngine = new CarEngineWhere(s);
                return(carEngine);

            case CarGearboxIDSearch s:
                var carGearbox = new CarGearboxIDWhere(s);
                return(carGearbox);

            case CarModelIDSearch s:
                var carModel = new CarModelIDWhere(s);
                return(carModel);

            case CarPriceSearch s:
                var carPrice = new CarPriceWhere(s);
                return(carPrice);

            case CarYearSearch s:
                var carYear = new CarYearWhere(s);
                return(carYear);

            case CarExtrasSearch s:
                var carExtras = new CarExtrasWhere(s);
                return(carExtras);

            case CarConditionSearch s:
                var carCondition = new CarContitionWhere(s);
                return(carCondition);

            case CarHorsePowerSearch s:
                var carHorsePower = new CarHorsePowerWhere(s);
                return(carHorsePower);

            case CarKilometersSearch s:
                var carKilometers = new CarKilometersWhere(s);
                return(carKilometers);

            case CarColourSearch s:
                var carColour = new CarColourWhere(s);
                return(carColour);

            case CarDateCreatedSearch s:
                var carLastTwoDays = new CarDateCreatedWhere(s);
                return(carLastTwoDays);

            case CarIDSearch s:
                var carID = new CarIDWhere(s);
                return(carID);

            default:
                throw new NotSupportedException();
            }
        }
Ejemplo n.º 6
0
 public UserApiController(
     IActionHandlerOverlord actionHandlerOverlord,
     IRepository <User> repository,
     IEntitySearch <User> entitySearch)
     : base(actionHandlerOverlord, repository, entitySearch)
 {
 }
 public OpeningHoursApiController(
     IActionHandlerOverlord actionHandlerOverlord,
     IRepository <TimeSlot> repository,
     IEntitySearch <TimeSlot> entitySearch)
     : base(actionHandlerOverlord, repository, entitySearch)
 {
 }
 public TeacherRateApiController(
     IActionHandlerOverlord actionHandlerOverlord,
     IRepository <Teacher> repository,
     IEntitySearch <Teacher> entitySearch)
     : base(actionHandlerOverlord, repository, entitySearch)
 {
 }
Ejemplo n.º 9
0
 protected GenericApiController(
     IActionHandlerOverlord actionHandlerOverlord,
     IRepository <TEntity> repository,
     IEntitySearch <TEntity> entitySearch)
 {
     _actionHandlerOverlord = actionHandlerOverlord;
     Repository             = repository;
     _entitySearch          = entitySearch;
 }
Ejemplo n.º 10
0
 public BlockApiController(
     IActionHandlerOverlord actionHandlerOverlord,
     IRepository <Block> repository,
     IEntitySearch <Block> entitySearch,
     ICurrentUser currentUser)
     : base(actionHandlerOverlord, repository, entitySearch)
 {
     _currentUser = currentUser;
 }
 public StandAloneEventApiController(
     IActionHandlerOverlord actionHandlerOverlord,
     IRepository <StandAloneEvent> repository,
     IEntitySearch <StandAloneEvent> entitySearch,
     ICurrentUser currentUser)
     : base(actionHandlerOverlord, repository, entitySearch)
 {
     _currentUser = currentUser;
 }
Ejemplo n.º 12
0
 public EnrolmentApiController(
     IActionHandlerOverlord actionHandlerOverlord,
     IRepository <User> repository,
     IEntitySearch <User> entitySearch,
     ICurrentUser currentUser)
     : base(actionHandlerOverlord, repository, entitySearch)
 {
     _currentUser = currentUser;
 }
Ejemplo n.º 13
0
 public SettingsController(
     IActionHandlerOverlord actionHandlerOverlord,
     IRepository <CompleteSettings> repository,
     IEntitySearch <CompleteSettings> entitySearch,
     IRepository <SettingItem> settingsRepository)
     : base(actionHandlerOverlord, repository, entitySearch)
 {
     _settingsRepository = settingsRepository;
 }
 public TeacherAvailabilitiesApiController(
     IActionHandlerOverlord actionHandlerOverlord,
     IRepository <TeacherAvailability> repository,
     IEntitySearch <TeacherAvailability> entitySearch,
     ICurrentUser currentUser)
     : base(actionHandlerOverlord, repository, entitySearch)
 {
     _currentUser = currentUser;
 }
Ejemplo n.º 15
0
 public CommunityGroupController(
     ILogger <CommunityGroupController> logger,
     IBfConfiguration configuration,
     IEntityRepository <CommunityGroup> entityRepo,
     IEntitySearch <CommunityGroup> searchRepo)
 {
     _logger        = logger;
     _configuration = configuration;
     _entityRepo    = entityRepo;
     _searchRepo    = searchRepo;
 }
 public PooledBookController(
     ILogger <PooledBookController> logger,
     IBfConfiguration configuration,
     IEntityRepository <PooledBook> entityRepo,
     IEntitySearch <PooledBook> searchRepo)
 {
     _logger        = logger;
     _configuration = configuration;
     _entityRepo    = entityRepo;
     _searchRepo    = searchRepo;
 }
Ejemplo n.º 17
0
        protected IActionResult ResourcesGet <TParameters>(TParameters parameters,
                                                           IEntityFilter <TEntity> entityFilter,
                                                           IEntitySearch <TEntity> entitySearch) where TParameters : class
        {
            if (!typeof(TDto).TypeHasOutputProperties(CollectionConfig.Shape))
            {
                return(BadRequest("Shape has one or more invalid field names."));
            }

            var orderByCheck = _orderByPropertyMappingService
                               .ClauseIsValid(CollectionConfig.OrderBy);

            if (!orderByCheck.Valid)
            {
                orderByCheck.Details.Instance = Url.Link(HateoasConfig.ResourcesGetRouteName, parameters);
                return(BadRequest(orderByCheck.Details));
            }

            var orderByMappings = _orderByPropertyMappingService.PropertyMapping();

            var pagedEntities = _restResourceRepository
                                .Load(
                CollectionConfig.Page,
                CollectionConfig.PageSize,
                entityFilter,
                entitySearch,
                CollectionConfig.SearchText,
                CollectionConfig.OrderBy,
                orderByMappings);

            AddPaginationHeader(HateoasConfig.ResourcesGetRouteName, pagedEntities);

            var resources = Mapper.Map <IEnumerable <TDto> >(pagedEntities)
                            .ShapeData(CollectionConfig.Shape).ToList();

            if (HateoasConfig.AddLinks)
            {
                AddHateoasLinksToResourceCollection(resources);
            }

            if (HateoasConfig.AddLinks)
            {
                var collectionLinks = ResourcesGetLinks(parameters, pagedEntities);

                var expandoObject = new { value = resources }.ShapeData("");
                expandoObject.TryAdd(HateoasConfig.LinksPropertyName, collectionLinks);

                return(Ok(expandoObject));
            }

            return(Ok(resources));
        }
Ejemplo n.º 18
0
                /// <summary>
                /// Retorna un objeto desde un entitySearch, el tipo del objeto de retorno será del tipo que utilice el atributo EntityIndexAttribute .
                /// para esto buscará todas las clases que tnengan el atributo EntityIndexAttribute que vincula la clase con el índice
                /// del entitySearch, una vez encontrada hará lo mismo con los atributos de cada propiedad para finalmente crear un objeto tipado con todos los valores del entitySearch.
                /// </summary>
                /// <typeparam name="T">Las entidades tienen un tipo de dato geo, que depende de la base de datos a usar.</typeparam>
                /// <param name="entitySearch">entitySearch a convertir</param>
                /// <param name="anyElementInAssembly">assembly donde buscar la clase que sea del tipo de la entidad</param>
                /// <param name="nms">namespace donde se encuentra la clase que sea del tipo de entidad</param>
                /// <param name="geoConvert"></param>
                /// <param name="sEntity"></param>
                /// <param name="hash"></param>
                /// <returns>objeto de una clase que representa una entidad</returns>
                public static object GetEntityFromSearch <T>(IEntitySearch <T> entitySearch, Type anyElementInAssembly, string nms, Func <T, object> geoConvert, ISearchEntity <T> sEntity, IHashSearchHelper hash)
                {
                    // obtiene el tipo de clase de acuerdo al índice de la entidad.
                    var type = GetEntityType(entitySearch.index, anyElementInAssembly, nms);


                    // crea una nueva instancia del tipo determinado por la entidad
                    // por ejemplo, si el indice de entidad correspondiera a 1 que es Persona, esta sería la clase persona.
                    var entity = Collections.CreateEntityInstance(type);


                    if (type.GetProperty("Id") == null)
                    {
                        throw new Exception("un elemento a convertir en EntitySearch debe llevar id");
                    }

                    // asigna el id del objeto convertido
                    // todas los elementos de la base de datos tienn la propiedad id.
                    type.GetProperty("Id")?.SetValue(entity, entitySearch.id);



                    // busca todas las propiedades que tengan el atributo baseIndexAttribute que identifica la metadata donde reside el índice y el tipo de dato.
                    var props = entity.GetType().GetProperties().Where(prop => Attribute.IsDefined(prop, typeof(BaseIndexAttribute), true)).ToList();



                    // recorre las propiedades de una clase y le asigna los valores correspondientes a las propiedades del entitySearch
                    props.ForEach(prop => {
                        // obtiene el atributo y su metadata
                        var attr = prop.GetCustomAttribute <BaseIndexAttribute>(true);

                        // con la metadata de la propiedad (índice, tipo de dato y si es o no entidad, obtiene el valor o la colección de valores de una propiedad.
                        var values = Collections.FormatValues(prop, GetValues <T>(entitySearch, attr.IsEntity, attr.KindIndex, attr.Index, geoConvert, hash, sEntity, anyElementInAssembly, nms));

                        // asigna el valor a la clase.
                        prop.SetValue(entity, values);
                    });

                    var hashModel  = hash.HashModel(entity);
                    var hashHeader = hash.HashHeader(type);


                    if (entitySearch.hh.Equals(hashHeader) && entitySearch.hm.Equals(hashModel))
                    {
                        // retorna un objeto tipado desde un entitySearch.
                        return(entity);
                    }
                    throw new Exception("Hash incorrectos");
                }
        private static IWhere CreateCarMakeWhereClause(IEntitySearch <CarMake> search)
        {
            switch (search)
            {
            case NameSearch r:
                var nameWhere = new NameWhere(r);
                return(nameWhere);

            case CarMakeIDSearch s:
                var carMake = new CarMakeIDWhere(s);
                return(carMake);

            default:
                throw new NotSupportedException();
            }
        }
Ejemplo n.º 20
0
 private EntitySearch Convert(IEntitySearch <GeographyPoint> entity) => new EntitySearch
 {
     id    = entity.id,
     index = entity.index,
     bl    = entity.bl.Select(s => new BoolProperty {
         index = s.index, value = s.value
     }).ToArray(),
     str = entity.str.Select(s => new StrProperty {
         index = s.index, value = s.value
     }).ToArray(),
     enm = entity.enm.Select(s => new EnumProperty {
         index = s.index, value = s.value
     }).ToArray(),
     dt = entity.dt.Select(s => new DtProperty {
         index = s.index, value = s.value
     }).ToArray(),
     dbl = entity.dbl.Select(s => new DblProperty {
         index = s.index, value = s.value
     }).ToArray(),
     rel = entity.rel.Select(s => new RelatedId {
         index = s.index, id = s.id
     }).ToArray(),
     geo = entity.geo.Select(s => new GeoProperty {
         index = s.index, value = s.value
     }).ToArray(),
     sug = entity.sug.Select(s => new StrProperty {
         index = s.index, value = s.value
     }).ToArray(),
     num64 = entity.num64.Select(s => new Num64Property {
         index = s.index, value = s.value
     }).ToArray(),
     num32 = entity.num32.Select(s => new Num32Property {
         index = s.index, value = s.value
     }).ToArray(),
     hh      = entity.hh,
     hm      = entity.hm,
     created = entity.created,
 };
        private static Expression <Func <TSource, bool> > GenerateSearchCriteriaExpression <TSource>(IList <string> tokens, IEntitySearch <TSource> filter)
            where TSource : class
        {
            List <Expression> orExpressions = new List <Expression>();

            var xExp = Expression.Parameter(typeof(TSource), "x");

            foreach (var propertyInfo in ReflectionHelper.GetPropertiesFromType(filter.GetSearchableProperties(typeof(TSource).GetProperties()), filter.QueryProperties))
            {
                Expression memberExp      = Expression.MakeMemberAccess(xExp, propertyInfo);
                Expression memberHasValue = null;
                if (memberExp.Type != typeof(string))
                {
                    if (Nullable.GetUnderlyingType(memberExp.Type) != null)
                    {
                        memberHasValue = Expression.MakeMemberAccess(memberExp, memberExp.Type.GetProperty("HasValue"));
                        memberHasValue = filter.QueryStrict ? memberHasValue : Expression.Not(memberHasValue);
                    }
                    else if (memberExp.Type.IsClass)
                    {
                        memberHasValue = Expression.Equal(memberExp, Expression.Constant(null));
                        memberHasValue = !filter.QueryStrict ? memberHasValue : Expression.Not(memberHasValue);
                    }
                    memberExp = Expression.Call(memberExp, ReflectionHelper.GetMethodFromType(memberExp.Type, "ToString", 0, 0));
                }
                else
                {
                    memberHasValue = Expression.Equal(memberExp, Expression.Constant(null));
                    memberHasValue = !filter.QueryStrict ? memberHasValue : Expression.Not(memberHasValue);
                }

                memberExp = Expression.Call(memberExp, ReflectionHelper.GetMethodFromType(memberExp.Type, "ToLower", 0, 0));
                List <Expression> andExpressions = new List <Expression>();

                foreach (var token in tokens)
                {
                    andExpressions.Add(ExpressionHelper.GenerateStringContainsExpression(memberExp, Expression.Constant(token, typeof(string))));
                }
                orExpressions.Add(filter.QueryStrict ? ExpressionHelper.GenerateAndExpressions(andExpressions) : ExpressionHelper.GenerateOrExpression(andExpressions));
            }

            Expression orExp = ExpressionHelper.GenerateOrExpression(orExpressions);

            return(Expression.Lambda <Func <TSource, bool> >(orExp.Reduce(), xExp));
        }
Ejemplo n.º 22
0
 /// <summary>
 /// Añade un elemento al search.
 /// </summary>
 /// <typeparam name="T">Esto debería ser EntitySearch</typeparam>
 /// <param name="elements"></param>
 public void AddElement(IEntitySearch <GeographyPoint> element)
 {
     OperationElements(new List <IEntitySearch <GeographyPoint> > {
         element
     }.Select(Convert).ToList(), SearchOperation.Add);
 }
        public static IQueryable <TSource> OrderBy <TSource>(this IQueryable <TSource> source, IEntitySearch <TSource> filter)
            where TSource : class
        {
            if (source == null)
            {
                throw new ArgumentNullException("source");
            }

            if (filter == null)
            {
                throw new ArgumentNullException(nameof(filter));
            }

            if (string.IsNullOrWhiteSpace(filter.OrderBy))
            {
                var someProperty = typeof(TSource).GetProperties().FirstOrDefault();
                if (someProperty == null)
                {
                    throw new ArgumentNullException(nameof(filter.OrderBy));
                }
                filter.OrderBy = someProperty.Name;
            }

            Type       type   = typeof(TSource);
            Expression lambda = ExpressionHelper.GenereteLambdaExpression <TSource>(ref type, filter.OrderBy);
            MethodInfo orderMethod;

            if (filter.Order == Order.ASCENDING)
            {
                orderMethod = ReflectionHelper.GetMethodFromType(typeof(Queryable), "OrderBy", 2, 2);
            }
            else
            {
                orderMethod = ReflectionHelper.GetMethodFromType(typeof(Queryable), "OrderByDescending", 2, 2);
            }

            return((IQueryable <TSource>)orderMethod.MakeGenericMethod(typeof(TSource), type).Invoke(null, new object[] { source, lambda }));
        }
Ejemplo n.º 24
0
 internal object ResourcesGet(object parameters, IEntityFilter <TestEntity> p1, IEntitySearch <TestEntity> p2)
 {
     return(base.ResourcesGet(parameters, p1, p2));
 }
        private static Expression <Func <TSource, bool> > GenerateFilterCriteriaExpression <TSource>(IEntitySearch <TSource> filter) where TSource : class
        {
            List <Expression> expressions = new List <Expression>();

            var xExp = Expression.Parameter(typeof(TSource), "x");

            foreach (var filterProperty in filter.FilterProperties)
            {
                var propertyParts = filterProperty.Key.Split("_");
                var property      = typeof(TSource).GetProperty(propertyParts[0]);

                Expression memberExp = Expression.MakeMemberAccess(xExp, property);

                if (propertyParts.Count() == 1)
                {
                    expressions.Add(ExpressionHelper.GenerateFilterComparationExpression(memberExp, filterProperty, property));
                }
                else
                {
                    expressions.Add(ExpressionHelper.GenerateFilterComparationExpression(memberExp, filterProperty, property, propertyParts[1]));
                }
            }

            Expression orExp = ExpressionHelper.GenerateAndExpressions(expressions);

            return(Expression.Lambda <Func <TSource, bool> >(orExp.Reduce(), xExp));
        }
        public static IQueryable <TSource> Filter <TSource>(this IQueryable <TSource> source, IEntitySearch <TSource> filter)
            where TSource : class
        {
            if (filter.FilterProperties == null || filter.FilterProperties.Count == 0)
            {
                return(source);
            }

            var criteriaExp = GenerateFilterCriteriaExpression(filter);

            return(source.Where(criteriaExp));
        }
        public static IQueryable <TSource> Search <TSource>(this IQueryable <TSource> source, IEntitySearch <TSource> filter)
            where TSource : class
        {
            if (string.IsNullOrWhiteSpace(filter.Query))
            {
                return(source);
            }

            var queryTokens = TokenHelper.GetTokens(filter.Query, filter.QueryPhrase);

            filter.Query = string.Join("+", queryTokens.ToArray());

            if (queryTokens.Count == 0)
            {
                return(source);
            }

            var criteriaExp = GenerateSearchCriteriaExpression(queryTokens, filter);

            return(source.Where(criteriaExp));
        }
 public static IQueryable <TSource> Scope <TSource>(this IQueryable <TSource> source, IEntitySearch <TSource> filter)
     where TSource : class
 {
     return(source.Skip(filter.PageNumber * filter.PageSize).Take(filter.PageSize));
 }
Ejemplo n.º 29
0
 public void AddElement(IEntitySearch <GeoPointType> element)
 {
     AddToQueried(nameof(AgroSearch <GeoPointType> .AddElement), JsonConvert.SerializeObject(element));
     baseMainSearch.AddElement(element);
 }
Ejemplo n.º 30
0
        private static void AddSearchElement(IEntitySearch <GeoPointTs> input)
        {
            var index = (EntityRelated)input.index;

            switch (index)
            {
            case EntityRelated.WAITINGHARVEST:
                AgroData.WaitingHarvestSearch = Mdm.Reflection.Collections.UpsertToCollection(input, AgroData.WaitingHarvestSearch);
                break;

            case EntityRelated.BARRACK:
                AgroData.BarracksSearch = Mdm.Reflection.Collections.UpsertToCollection(input, AgroData.BarracksSearch);
                break;

            case EntityRelated.BUSINESSNAME:
                AgroData.BusinessNamesSearch = Mdm.Reflection.Collections.UpsertToCollection(input, AgroData.BusinessNamesSearch);
                break;

            case EntityRelated.CATEGORY_INGREDIENT:
                AgroData.IngredientCategoriesSearch = Mdm.Reflection.Collections.UpsertToCollection(input, AgroData.IngredientCategoriesSearch);
                break;

            case EntityRelated.CERTIFIED_ENTITY:
                AgroData.CertifiedEntitiesSearch = Mdm.Reflection.Collections.UpsertToCollection(input, AgroData.CertifiedEntitiesSearch);
                break;

            case EntityRelated.COSTCENTER:
                AgroData.CostCentersSearch = Mdm.Reflection.Collections.UpsertToCollection(input, AgroData.CostCentersSearch);
                break;

            case EntityRelated.DOSES:
                AgroData.DosesSearch = Mdm.Reflection.Collections.UpsertToCollection(input, AgroData.DosesSearch);
                break;

            case EntityRelated.INGREDIENT:
                AgroData.IngredientsSearch = Mdm.Reflection.Collections.UpsertToCollection(input, AgroData.IngredientsSearch);
                break;

            case EntityRelated.JOB:
                AgroData.JobsSearch = Mdm.Reflection.Collections.UpsertToCollection(input, AgroData.JobsSearch);
                break;

            case EntityRelated.NEBULIZER:
                AgroData.NebulizersSearch = Mdm.Reflection.Collections.UpsertToCollection(input, AgroData.NebulizersSearch);
                break;

            case EntityRelated.PHENOLOGICAL_EVENT:
                AgroData.PhenologicalEventsSearch = Mdm.Reflection.Collections.UpsertToCollection(input, AgroData.PhenologicalEventsSearch);
                break;

            case EntityRelated.PLOTLAND:
                AgroData.PlotLandsSearch = Mdm.Reflection.Collections.UpsertToCollection(input, AgroData.PlotLandsSearch);
                break;

            case EntityRelated.PRODUCT:
                AgroData.ProductSearchs = Mdm.Reflection.Collections.UpsertToCollection(input, AgroData.ProductSearchs);
                break;

            case EntityRelated.ROLE:
                AgroData.RolesSearch = Mdm.Reflection.Collections.UpsertToCollection(input, AgroData.RolesSearch);
                break;

            case EntityRelated.ROOTSTOCK:
                AgroData.RootstocksSearch = Mdm.Reflection.Collections.UpsertToCollection(input, AgroData.RootstocksSearch);
                break;

            case EntityRelated.SEASON:
                AgroData.SeasonsSearch = Mdm.Reflection.Collections.UpsertToCollection(input, AgroData.SeasonsSearch);
                break;

            case EntityRelated.SECTOR:
                AgroData.SectorsSearch = Mdm.Reflection.Collections.UpsertToCollection(input, AgroData.SectorsSearch);
                break;

            case EntityRelated.PREORDER:
                AgroData.PreOrdersSearch = Mdm.Reflection.Collections.UpsertToCollection(input, AgroData.PreOrdersSearch);
                break;

            case EntityRelated.TARGET:
                AgroData.ApplicationTargetsSearch = Mdm.Reflection.Collections.UpsertToCollection(input, AgroData.ApplicationTargetsSearch);
                break;

            case EntityRelated.TRACTOR:
                AgroData.TractorsSearch = Mdm.Reflection.Collections.UpsertToCollection(input, AgroData.TractorsSearch);
                break;

            case EntityRelated.USER:
                break;

            case EntityRelated.VARIETY:
                AgroData.VarietiesSearch = Mdm.Reflection.Collections.UpsertToCollection(input, AgroData.VarietiesSearch);
                break;

            case EntityRelated.NOTIFICATION_EVENT:
                break;

            case EntityRelated.POLLINATOR:
                break;

            case EntityRelated.ORDER_FOLDER:
                AgroData.OrderFoldersSearch = Mdm.Reflection.Collections.UpsertToCollection(input, AgroData.OrderFoldersSearch);
                break;

            case EntityRelated.EXECUTION_ORDER:
                break;

            case EntityRelated.ORDER:
                break;

            case EntityRelated.BARRACK_EVENT:
                break;

            case EntityRelated.DOSES_ORDER:
                break;

            case EntityRelated.EXECUTION_ORDER_STATUS:
                break;

            case EntityRelated.SPECIE:
                AgroData.SpeciesSearch = Mdm.Reflection.Collections.UpsertToCollection(input, AgroData.SpeciesSearch);
                break;

            case EntityRelated.GEOPOINT:
                break;

            case EntityRelated.BRAND:
                AgroData.BrandsSearch = Mdm.Reflection.Collections.UpsertToCollection(input, AgroData.BrandsSearch);
                break;

            default:
                break;
            }
        }