private ISearchParameterBase InitalizeSearchParameter(SearchParamType DbSearchParameterType)
        {
            switch (DbSearchParameterType)
            {
            case SearchParamType.Number:
                return(new SearchParameterNumber());

            case SearchParamType.Date:
                return(new SearchParameterDateTime());

            case SearchParamType.String:
                return(new SearchParameterString());

            case SearchParamType.Token:
                return(new SearchParameterToken());

            case SearchParamType.Reference:
                return(ISearchParameterReferanceFactory.CreateDtoSearchParameterReferance());

            case SearchParamType.Composite:
                return(new SearchParameterComposite());

            case SearchParamType.Quantity:
                return(new SearchParameterQuantity());

            case SearchParamType.Uri:
                return(new SearchParameterUri());

            default:
                throw new System.ComponentModel.InvalidEnumArgumentException(DbSearchParameterType.ToString(), (int)DbSearchParameterType, typeof(SearchParamType));
            }
        }
Пример #2
0
        private ISearchParameterBase InitalizeSearchParameter(SearchParamType DbSearchParameterType)
        {
            switch (DbSearchParameterType)
            {
            case SearchParamType.Number:
                return(new SearchParameterNumber());

            case SearchParamType.Date:
                //I think I need to make one of these handle both Date and DateTime, the value given will be one or the other
                return(new SearchParameterDateTime());

            //return new DtoSearchParameterDate();
            case SearchParamType.String:
                return(new SearchParameterString());

            case SearchParamType.Token:
                return(new SearchParameterToken());

            case SearchParamType.Reference:
                return(ISearchParameterReferanceFactory.CreateDtoSearchParameterReferance());

            case SearchParamType.Composite:
                throw new System.ComponentModel.InvalidEnumArgumentException(DbSearchParameterType.ToString(), (int)DbSearchParameterType, typeof(SearchParamType));

            case SearchParamType.Quantity:
                return(new SearchParameterQuantity());

            case SearchParamType.Uri:
                return(new SearchParameterUri());

            default:
                throw new System.ComponentModel.InvalidEnumArgumentException(DbSearchParameterType.ToString(), (int)DbSearchParameterType, typeof(SearchParamType));
            }
        }