/// <summary>
        /// Search for OrganisationTypeGroup items
        /// </summary>
        /// <param name="currentUser"></param>
        /// <param name="user"></param>
        /// <param name="appID"></param>
        /// <param name="overrideID"></param>
        /// <param name="searchCriteria"></param>
        /// <param name="page"></param>
        /// <param name="pageSize"></param>
        /// <param name="includeInActive"></param>
        /// <param name="specification"></param>
        /// <param name="dataRepository"></param>
        /// <param name="uow"></param>
        /// <returns></returns>
        public OrganisationTypeGroupSearchVMDC SearchOrganisationTypeGroup(string currentUser, string user, string appID, string overrideID, OrganisationTypeGroupSearchCriteriaDC searchCriteria, int page, int pageSize, bool includeInActive,
                                                                           ISpecification <OrganisationTypeGroup> specification, ISpecification <OrganisationTypeGroup> isActiveSpecification, IRepository <OrganisationTypeGroup> dataRepository, IUnitOfWork uow, IExceptionManager exceptionManager, IMappingService mappingService)
        {
            try
            {
                #region Parameter validation

                // Validate parameters
                if (string.IsNullOrEmpty(currentUser))
                {
                    throw new ArgumentOutOfRangeException("currentUser");
                }
                if (string.IsNullOrEmpty(user))
                {
                    throw new ArgumentOutOfRangeException("user");
                }
                if (string.IsNullOrEmpty(appID))
                {
                    throw new ArgumentOutOfRangeException("appID");
                }
                if (null == dataRepository)
                {
                    throw new ArgumentOutOfRangeException("dataRepository");
                }
                if (null == specification)
                {
                    throw new ArgumentOutOfRangeException("specification");
                }
                if (null == uow)
                {
                    throw new ArgumentOutOfRangeException("uow");
                }
                if (null == exceptionManager)
                {
                    throw new ArgumentOutOfRangeException("exceptionManager");
                }
                if (null == mappingService)
                {
                    throw new ArgumentOutOfRangeException("mappingService");
                }

                #endregion

                using (uow)
                {
                    // Evaluate search criteria if supplied
                    if (null != searchCriteria)
                    {
                        EvaluateOrganisationTypeGroupSearchCriteria(searchCriteria, ref specification);
                    }

                    if (!includeInActive)
                    {
                        specification = specification.And(isActiveSpecification);
                    }

                    // Set default sort expression
                    System.Linq.Expressions.Expression <Func <OrganisationTypeGroup, Object> > sortExpression = x => new { x.Name };

                    // Find all items that satisfy the specification created above.
                    IEnumerable <OrganisationTypeGroup> dataEntities = dataRepository.Find(specification, sortExpression, page, pageSize);

                    // Get total count of items for search critera
                    int itemCount = dataRepository.Count(specification);

                    OrganisationTypeGroupSearchVMDC results = new OrganisationTypeGroupSearchVMDC();

                    // Convert to data contracts
                    List <OrganisationTypeGroupSearchMatchDC> destinations = mappingService.Map <IEnumerable <OrganisationTypeGroup>, List <OrganisationTypeGroupSearchMatchDC> >(dataEntities);

                    results.MatchList      = destinations;
                    results.SearchCriteria = searchCriteria;
                    results.RecordCount    = itemCount;

                    return(results);
                }
            }
            catch (Exception e)
            {
                //Prevent exception from propogating across the service interface
                exceptionManager.ShieldException(e);

                return(null);
            }
        }
 // Partial method for evaluation of OrganisationTypeGroup search criteria
 partial void EvaluateOrganisationTypeGroupSearchCriteria(OrganisationTypeGroupSearchCriteriaDC searchCriteria, ref ISpecification <OrganisationTypeGroup> specification);
        /// <summary>
        /// Search for OrganisationTypeGroup items
        /// </summary>
        /// <param name="currentUser"></param>
        /// <param name="user"></param>
        /// <param name="appID"></param>
        /// <param name="overrideID"></param>
        /// <param name="searchCriteria"></param>
        /// <param name="page"></param>
        /// <param name="pageSize"></param>
        /// <param name="includeInActive"></param>
        /// <returns></returns>
        public OrganisationTypeGroupSearchVMDC SearchOrganisationTypeGroup(string currentUser, string user, string appID, string overrideID, OrganisationTypeGroupSearchCriteriaDC searchCriteria, int page, int pageSize, bool includeInActive)
        {
            // Create unit of work
            IUnitOfWork uow = new UnitOfWork(currentUser);

            // Create repository
            IRepository <OrganisationTypeGroup> dataRepository = new Repository <OrganisationTypeGroup>(uow.ObjectContext, currentUser, user, appID, overrideID);

            // Create specification for filtering
            ISpecification <OrganisationTypeGroup> specification = new Specification <OrganisationTypeGroup>();

            // Create isActive specification
            ISpecification <OrganisationTypeGroup> isActiveSpecification = new IsActiveSpecification <OrganisationTypeGroup>();

            //Create ExceptionManager
            IExceptionManager exceptionManager = new ExceptionManager();

            //Create MappingService
            IMappingService mappingService = new MappingService();

            // Call overload with injected objects
            return(SearchOrganisationTypeGroup(currentUser, user, appID, overrideID, searchCriteria, page, pageSize, includeInActive, specification, isActiveSpecification, dataRepository, uow, exceptionManager, mappingService));
        }