Implements a read-only
Although this is advertised as immutable, it really isn't. Anyone with access to the - wrapped set can still change the set.
-Implements a thread-safe
- public IStreamedData ExecuteInMemory (IStreamedData input)
- {
- ArgumentUtility.CheckNotNull ("input", input);
- return InvokeGenericExecuteMethod<StreamedSequence, StreamedValue> (input, ExecuteInMemory<object>);
- }
-
- public StreamedValue ExecuteInMemory<T> (StreamedSequence input)
- {
- var sequence = input.GetTypedSequence<T> ();
- var result = sequence.Sequence.Count ();
- return new StreamedValue (result);
- }
-
-
- var result = (from s in Students
- select s).Any();
-
-
- var result = (from s in Students
- select s).All();
-
-
- var result = (from s in Students
- select s.Name).Aggregate((allNames, name) => allNames + " " + name);
-
-
- var result = (from s in Students
- select s).Aggregate(0, (totalAge, s) => totalAge + s.Age);
-
-
- var query = from s in Students
- join a in Addresses on s.AdressID equals a.ID into addresses
- from a in addresses
- select new { s, a };
-
-
- var query = (from s in Students
- select s.ID).Average();
-
-
- var query = (from s in Students
- select s.ID).Cast<int>();
-
-
- var query = (from s in Students
- select s).Contains (student);
-
-
- var query = (from s in Students
- select s).DefaultIfEmpty ("student");
-
-
- var query = (from s in Students
- select s).Except(students2);
-
-
- var query = (from s in Students
- select s).Intersect(students2);
-
-
- var query = (from s in Students
- select s).LongCount();
-
-
- var query = (from s in Students
- select s.ID).OfType<int>();
-
-
- var query = (from s in Students
- select s).Reverse();
-
-
- var query = (from s in Students
- select s).Skip (3);
-
-
- var query = (from s in Students
- select s.ID).Sum();
-
-
- var query = (from s in Students
- select s.ID).Max();
-
-
- var query = (from s in Students
- select s.ID).Min();
-
-
- var query = (from s in Students
- select s).Last();
-
-
- var query = (from s in Students
- select s).Take(3);
-
-
- var query = (from s in Students
- select s).First();
-
-
- var query = (from s in Students
- select s).Single();
-
-
- var query = (from s in Students
- select s).Distinct();
-
-
- var query = (from s in Students
- select s).Count();
-
-
- var query = (from s in Students
- select s).Union(students2);
-
-
- MainSource (...)
- .Select (x => x)
- .Distinct ()
- .Select (x => x)
-
-
- Naively, the last Select node would resolve (via Distinct and Select) to the
- MainSource (MainSource (...).Select (x => x).Distinct ())
- .Select (x => x)
-
-
- Now, the last Select node resolves to the new
- x.GroupBy (k => key, e => element, (k, g) => result)
-
- is therefore equivalent to:
-
- c.GroupBy (k => key, e => element).Select (grouping => resultSub)
-
- where resultSub is the same as result with k and g substituted with grouping.Key and grouping, respectively.
-
- from c in Customers
- from o in (from oi in OrderInfos where oi.Customer == c orderby oi.OrderDate select oi.Order)
- orderby o.Product.Name
- select new { c, o }
-
- This will be transformed into:
-
- from c in Customers
- from oi in OrderInfos
- where oi.Customer == c
- orderby oi.OrderDate
- orderby oi.Order.Product.Name
- select new { c, oi.Order }
-
- As another example, take the following query:
-
- from c in (from o in Orders select o.Customer)
- where c.Name.StartsWith ("Miller")
- select c
-
- (This query is never produced by the
- from o in Orders
- where o.Customer.Name.StartsWith ("Miller")
- select o
-
-
- var query = from s in Students
- where s.First == "Hugo"
- group s by s.Country;
-
-
- var query = from s in Students
- join a in Addresses on s.AdressID equals a.ID
- select new { s, a };
-
-
- from order in ...
- select order.OrderItems.Count()
-
- In this query, the
- var query = from s in Students
- where s.First == "Hugo"
- select s;
-
- ("o", o);
- }
- ]]>
- In some other cases, the input value is returned unmodified. This makes it easier to use the argument checks in calls to base class constructors
- or property setters:
-
-
- CREATE TABLE [dbo].[Log] (
- [ID] [int] IDENTITY (1, 1) NOT NULL ,
- [Date] [datetime] NOT NULL ,
- [Thread] [varchar] (255) NOT NULL ,
- [Level] [varchar] (20) NOT NULL ,
- [Logger] [varchar] (255) NOT NULL ,
- [Message] [varchar] (4000) NOT NULL
- ) ON [PRIMARY]
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- "DSN=MS Access Database;UID=admin;PWD=;SystemDB=C:\data\System.mdw;SafeTransactions = 0;FIL=MS Access;DriverID = 25;DBQ=C:\data\train33.mdb"
- "Driver={Microsoft Access Driver (*.mdb)};DBQ=C:\Work\cvs_root\log4net-1.2\access.mdb;UID=;PWD=;"
- "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Work\cvs_root\log4net-1.2\access.mdb;User Id=;Password=;"
- System.Data.OleDb.OleDbConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
- System.Data.SqlClient.SqlConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
- Microsoft.Data.Odbc.OdbcConnection,Microsoft.Data.Odbc,version=1.0.3300.0,publicKeyToken=b77a5c561934e089,culture=neutral
- This is an optional package that you can download from
- http://msdn.microsoft.com/downloads
- search for ODBC .NET Data Provider.
- System.Data.OracleClient.OracleConnection, System.Data.OracleClient, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
- This is an optional package that you can download from
- http://msdn.microsoft.com/downloads
- search for .NET Managed Provider for Oracle.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <mapping>
- <level value="ERROR" />
- <eventLogEntryType value="Error" />
- </mapping>
- <mapping>
- <level value="DEBUG" />
- <eventLogEntryType value="Information" />
- </mapping>
-
-
-
-
-
-
-
-
-
- IPEndPoint remoteEndPoint = new IPEndPoint(IPAddress.Any, 0);
- UdpClient udpClient;
- byte[] buffer;
- string loggingEvent;
-
- try
- {
- udpClient = new UdpClient(8080);
-
- while(true)
- {
- buffer = udpClient.Receive(ref remoteEndPoint);
- loggingEvent = System.Text.Encoding.Unicode.GetString(buffer);
- Console.WriteLine(loggingEvent);
- }
- }
- catch(Exception e)
- {
- Console.WriteLine(e.ToString());
- }
-
-
- Dim remoteEndPoint as IPEndPoint
- Dim udpClient as UdpClient
- Dim buffer as Byte()
- Dim loggingEvent as String
-
- Try
- remoteEndPoint = new IPEndPoint(IPAddress.Any, 0)
- udpClient = new UdpClient(8080)
-
- While True
- buffer = udpClient.Receive(ByRef remoteEndPoint)
- loggingEvent = System.Text.Encoding.Unicode.GetString(buffer)
- Console.WriteLine(loggingEvent)
- Wend
- Catch e As Exception
- Console.WriteLine(e.ToString())
- End Try
-
-
-
-
-
-
-
-
-
- using log4net.Config;
- using System.IO;
- using System.Configuration;
-
- ...
-
- DOMConfigurator.Configure(new FileInfo(ConfigurationSettings.AppSettings["log4net-config-file"]));
-
-
-
-
-
-
-
-
-
- using log4net.Config;
- using System.IO;
- using System.Configuration;
-
- ...
-
- DOMConfigurator.Configure(new FileInfo(ConfigurationSettings.AppSettings["log4net-config-file"]));
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- log4net configuration XML goes here
-
-
-
-
-
-
-
-
-
- using log4net.Config;
- using System.IO;
- using System.Configuration;
-
- ...
-
- XmlConfigurator.Configure(new FileInfo(ConfigurationSettings.AppSettings["log4net-config-file"]));
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- using log4net.Config;
- using System.IO;
- using System.Configuration;
-
- ...
-
- XmlConfigurator.Configure(new FileInfo(ConfigurationSettings.AppSettings["log4net-config-file"]));
-
-
-
-
-
-
-
-
-
- ILog log = LogManager.GetLogger("application-log");
-
- log.Info("Application Start");
- log.Debug("This is a debug message");
-
- if (log.IsDebugEnabled)
- {
- log.Debug("This is another debug message");
- }
-
-
- log.Debug("This is entry number: " + i );
-
-
- if (log.IsDebugEnabled)
- {
- log.Debug("This is entry number: " + i );
- }
-
-
- private static readonly bool isDebugEnabled = log.IsDebugEnabled;
-
-
- if (isDebugEnabled)
- {
- log.Debug("This is entry number: " + i );
- }
-
-
- log.Debug("This is entry number: " + i );
-
-
- if (log.IsDebugEnabled())
- {
- log.Debug("This is entry number: " + i );
- }
-
-
- {key1=value1, key2=value2, key3=value3}
-
-
- StringWriter writer = new StringWriter();
- Layout.Format(writer, loggingEvent);
- string formattedEvent = writer.ToString();
-
-
- ILog log = LogManager.GetLogger(typeof(TestApp));
- log.Debug("Message 1");
- log.Warn("Message 2");
-
-
- DEBUG [main]: Message 1
- WARN [main]: Message 2
-
- Format modifier | -left justify | -minimum width | -maximum width | -comment | -
---|---|---|---|---|
%20logger | -false | -20 | -none | -
- |
-
%-20logger | -true | -20 | -none | -
- |
-
%.30logger | -NA | -none | -30 | -
- |
-
false | -20 | -30 | -
- |
- |
%-20.30logger | -true | -20 | -30 | -
- |
-
%timestamp [%thread] %level %logger %ndc - %message%newline
- %-6timestamp [%15.15thread] %-5level %30.30logger %ndc - %message%newline
-
- DEBUG - Hello world
-
-
- <?xml version="1.0" ?>
-
- <!DOCTYPE log4net:events SYSTEM "log4net-events.dtd" [<!ENTITY data SYSTEM "abc">]>
-
- <log4net:events version="1.2" xmlns:log4net="http://logging.apache.org/log4net/schemas/log4net-events-1.2>
- &data;
- </log4net:events>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- string s = OptionConverter.SubstituteVariables("Value of key is ${key}.");
-
-
- string s = OptionConverter.SubstituteVariables("Value of nonExistentKey is [${nonExistentKey}]");
-
-
- using(log4net.ThreadContext.Stacks["NDC"].Push("Stack_Message"))
- {
- log.Warn("This should have an ThreadContext Stack message");
- }
-
-
- GlobalContext.Properties["hostname"] = Environment.MachineName;
-
-
- LogicalThreadContext.Properties["user"] = userName;
- log.Info("This log message has a LogicalThreadContext Property called 'user'");
-
-
- using(LogicalThreadContext.Stacks["LDC"].Push("my context message"))
- {
- log.Info("This log message has a LogicalThreadContext Stack message that includes 'my context message'");
-
- } // at the end of the using block the message is automatically popped
-
-
- ILog log = LogManager.GetLogger("application-log");
-
- log.Info("Application Start");
- log.Debug("This is a debug message");
-
- if (log.IsDebugEnabled)
- {
- log.Debug("This is another debug message");
- }
-
-
- using(NDC.Push("my context message"))
- {
- ... all log calls will have 'my context message' included ...
-
- } // at the end of the using block the message is automatically removed
-
-
- using(log4net.NDC.Push("NDC_Message"))
- {
- log.Warn("This should have an NDC message");
- }
-
-
- ThreadContext.Properties["user"] = userName;
- log.Info("This log message has a ThreadContext Property called 'user'");
-
-
- using(ThreadContext.Stacks["NDC"].Push("my context message"))
- {
- log.Info("This log message has a ThreadContext Stack message that includes 'my context message'");
-
- } // at the end of the using block the message is automatically popped
-
- null
- If the object is null
then an null
- If the object is null
then an null
- If the object is null
then an null
- If the object is null
then an null
- If the object is null
then an null
- If the object is null
then an null
- If the object is not null
then an null
- If the object is not null
then an null
- If the object is not null
then an null
- If the object is not null
then an null
- If the object is not null
then an null
- If the object is not null
then an NaN
value.
- If the object is not NaN
then an NaN
value.
- If the object is not NaN
then an NaN
value.
- If the object is not NaN
then an NaN
value.
- If the object is not NaN
then an NaN
value.
- If the object is not NaN
then an NaN
value.
- If the object is not NaN
then an