public Stream GetContactsWithMinutes(QuryType qt, Guid ContactId)
        {
            // http://localhost:6090/0/rest/WorkshopWebService/GetContactsWithMinutes?qt=1&ContactId=410006e1-ca4e-4502-a9ec-e54d922d2c00
            Timer.Start();
            Tuple <DataTable, string> result;

            switch (qt)
            {
            case QuryType.SELECT:
                result = ReadingData.GetContactsWithMinutesSelect(ContactId);
                break;

            case QuryType.ESQ:
                result = ReadingData.GetContactsWithMinutesEsq(ContactId);
                break;

            case QuryType.CustomQuery:
                result = ReadingData.GetAllContactsCustomQuery();
                break;

            default:
                result = ReadingData.GetAllDataReverseJoinEsq();
                break;
            }
            Timer.Stop();

            string htmlPage = result.Item1.GetHtmlPage(Timer.ElapsedTicks, result.Item2, qt.ToString());

            return(GetMemoryStream(htmlPage));
        }
        public Stream GetFilteredContacts(QuryType qt, string email)
        {
            //http://localhost:6090/0/rest/WorkshopWebService/GetFilteredContacts?qt=0&[email protected]
            Timer.Start();
            Tuple <DataTable, string> result;

            switch (qt)
            {
            case QuryType.SELECT:
                result = ReadingData.GetFilteredContactsSelect(email);
                break;

            case QuryType.ESQ:
                result = ReadingData.GetFilteredContactsEsq(email);
                break;

            case QuryType.CustomQuery:
                result = ReadingData.GetFilteredContactsCustomQuery(email);
                break;

            default:
                result = ReadingData.GetFilteredContactsSelect(email);
                break;
            }
            Timer.Stop();

            string htmlPage = result.Item1.GetHtmlPage(Timer.ElapsedTicks, result.Item2, qt.ToString());

            return(GetMemoryStream(htmlPage));
        }
        public Stream GetAllDataReverseJoin(QuryType qt)
        {
            // This is simple example of EntitySchemaQuery and use of reverse join expressions
            // Example to run:
            // http://localhost:6090/0/rest/WorkshopWebService/GetAllDataReverseJoin?qt=1
            Timer.Start();
            Tuple <DataTable, string> result;

            switch (qt)
            {
            case QuryType.SELECT:
                result = ReadingData.GetAllDataReverseJoinSelect();
                break;

            case QuryType.ESQ:
                result = ReadingData.GetAllDataReverseJoinEsq();
                break;

            case QuryType.CustomQuery:
                result = ReadingData.GetAllContactsCustomQuery();
                break;

            default:
                result = ReadingData.GetAllDataReverseJoinEsq();
                break;
            }
            Timer.Stop();

            string htmlPage = result.Item1.GetHtmlPage(Timer.ElapsedTicks, result.Item2, qt.ToString());

            return(GetMemoryStream(htmlPage));
        }