示例#1
0
        private static IEnumerable <string> selectCustomers(string country, string startDate, string endDate)
        {
            NorthwindEntities entities       = new NorthwindEntities();
            string            nativeSQLQuery =
                "SELECT Distinct CustomerID " +
                "FROM dbo.Orders " +
                "WHERE ShipCountry = {0} AND OrderDate BETWEEN {1} AND {2}";

            object[] parameters = { country, startDate, endDate };
            var      employees  = entities.ExecuteStoreQuery <string>(
                nativeSQLQuery, parameters);

            return(employees);
        }