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
+ If this ConnectionProvider is being Finalized (
+ If any subclasses manage resources that also need to be disposed of this method + should be overridden, but don't forget to call it in the override. +
+
+ List results = session.CreateCriteria(typeof(Parent))
+ .Add( Example.Create(parent).IgnoreCase() )
+ .CreateCriteria("child")
+ .Add( Example.Create( parent.Child ) )
+ .List();
+
+ SELECT
clause SELECT
clause (
+ This method assumes that the name is not already Quoted. So if the name passed
+ in is
+ If the aliasName is already enclosed in the OpenQuote and CloseQuote then this + method will return the aliasName that was passed in without going through any + Quoting process. So if aliasName is passed in already Quoted make sure that + you have escaped all of the chars according to your DataBase's specifications. +
++ If the columnName is already enclosed in the OpenQuote and CloseQuote then this + method will return the columnName that was passed in without going through any + Quoting process. So if columnName is passed in already Quoted make sure that + you have escaped all of the chars according to your DataBase's specifications. +
++ If the tableName is already enclosed in the OpenQuote and CloseQuote then this + method will return the tableName that was passed in without going through any + Quoting process. So if tableName is passed in already Quoted make sure that + you have escaped all of the chars according to your DataBase's specifications. +
++ If the schemaName is already enclosed in the OpenQuote and CloseQuote then this + method will return the schemaName that was passed in without going through any + Quoting process. So if schemaName is passed in already Quoted make sure that + you have escaped all of the chars according to your DataBase's specifications. +
++ If the catalogName is already enclosed in the OpenQuote and CloseQuote then this + method will return the catalogName that was passed in without going through any + Quoting process. So if catalogName is passed in already Quoted make sure that + you have escaped all of the chars according to your DataBase's specifications. +
+
+ This method checks the string
+ After the OpenQuote and CloseQuote have been cleaned from the string
+ The following quoted values return these results + "quoted" = quoted + "quote""d" = quote"d + quote""d = quote"d +
++ If this implementation is not sufficient for your Dialect then it needs to be overridden. + MsSql2000Dialect is an example of where UnQuoting rules are different. +
+concat(?1, ?2)
to concatenate two strings
+ p1 and p2. Target SQL function will be dialect-specific, e.g. (?1 || ?2)
for
+ Oracle, concat(?1, ?2)
for MySql, (?1 + ?2)
for MS SQL.
+ Each dialect will define a template as a string (exactly like above) marking function
+ parameters with '?' followed by parameter's index (first index is 1).
+ + Author: Ioan Bizau +
++ This dialect probably will not work with schema-export. If anyone out there + can fill in the ctor with DbTypes to Strings that would be helpful. +
+ The dialect defaults the following configuration properties: +
+ Names.Put(DbType, "TEXT" );
+ Names.Put(DbType, 255, "VARCHAR($l)" );
+ Names.Put(DbType, 65534, "LONGVARCHAR($l)" );
+
+ will give you back the following:
+
+ Names.Get(DbType) // --> "TEXT" (default)
+ Names.Get(DbType,100) // --> "VARCHAR(100)" (100 is in [0:255])
+ Names.Get(DbType,1000) // --> "LONGVARCHAR(1000)" (100 is in [256:65534])
+ Names.Get(DbType,100000) // --> "TEXT" (default)
+
+ On the other hand, simply putting
+
+ Names.Put(DbType, "VARCHAR($l)" );
+
+ would result in
+
+ Names.Get(DbType) // --> "VARCHAR($l)" (will cause trouble)
+ Names.Get(DbType,100) // --> "VARCHAR(100)"
+ Names.Get(DbType,1000) // --> "VARCHAR(1000)"
+ Names.Get(DbType,10000) // --> "VARCHAR(10000)"
+
+ + Author: Nikolaos Tountas +
++ In order to use this Driver you must have the Community.CsharpSqlite.dll and Community.CsharpSqlite.SQLiteClient assemblies referenced. +
++ Please check http://code.google.com/p/csharp-sqlite/ for more information regarding csharp-sqlite. +
+DbParameter param = cmd.Parameters["@paramName"]
+ if this is false the code will be
+ DbParameter param = cmd.Parameters["paramName"]
.
+
+ key="connection.driver_class"
+ value="FullyQualifiedClassName, AssemblyName"
+
+ + Author: Oliver Weichhold +
++ In order to use this Driver you must have the Npgsql.dll Assembly available for + NHibernate to load it. +
++ Please check the products website + http://www.postgresql.org/ + for any updates and or documentation. +
++ The homepage for the .NET DataProvider is: + http://pgfoundry.org/projects/npgsql. +
+
+ Abstracts ADO.NET batching to maintain the illusion that a single logical batch
+ exists for the whole session, even when batching is disabled.
+ Provides transparent
+ This will be useful once ADO.NET gets support for batching. Until that point + no code exists that will do batching, but this will provide a good point to do + error checking and making sure the correct number of rows were affected. +
+
+ ( query ( SELECT_FROM {filter-implied FROM} ) ( where ( = X 10 ) ) )
+
+ gets converted to
+
+ ( query ( SELECT_FROM ( FROM NHibernate.DomainModel.Many this ) ) ( where ( = X 10 ) ) )
+
+ select v as value from tab1 order by value
+ "value" used in the order by clause is a reference to the result_variable, "value", defined in the select clause.
+
+ IList cats = session.CreateCriteria(typeof(Cat))
+ .Add(Expression.Like("name", "Iz%"))
+ .Add(Expression.Gt("weight", minWeight))
+ .AddOrder(Order.Asc("age"))
+ .List();
+
+ You may navigate associations using
+ IList<Cat> cats = session.CreateCriteria<Cat>
+ .CreateCriteria("kittens")
+ .Add(Expression.like("name", "Iz%"))
+ .List<Cat>();
+
+
+ IList<Cat> cats = session.CreateCriteria<Cat>
+ .SetProjection(
+ Projections.ProjectionList()
+ .Add(Projections.RowCount())
+ .Add(Projections.Avg("weight"))
+ .Add(Projections.Max("weight"))
+ .Add(Projections.Min("weight"))
+ .Add(Projections.GroupProperty("color")))
+ .AddOrder(Order.Asc("color"))
+ .List<Cat>();
+
+
+ This id generation strategy is specified in the mapping file as
+ <generator class="assigned" />
+
NAME | +DEFAULT | +DESCRIPTION | +
The name of the sequence/table to use to store/retrieve values | +||
The initial value to be stored for the given segment; the effect in terms of storage varies based on |
+ ||
The increment size for the underlying segment; the effect in terms of storage varies based on |
+ ||
depends on defined increment size | +Allows explicit definition of which optimization strategy to use | +|
false | +Allows explicit definition of which optimization strategy to use | +
NAME | +DEFAULT | +DESCRIPTION | +
The name of column which holds the sequence value for the given segment | +
NAME | +DEFAULT | +DESCRIPTION | +
The name of the table to use to store/retrieve values | +||
The name of column which holds the sequence value for the given segment | +||
The name of the column which holds the segment key | +||
The value indicating which segment is used by this generator; refers to values in the |
+ ||
The data length of the |
+ ||
The initial value to be stored for the given segment | +||
The increment size for the underlying segment; see the discussion on |
+ ||
depends on defined increment size | +Allows explicit definition of which optimization strategy to use | +
+ <generator class="foreign">
+ <param name="property">AssociatedObject</param>
+ </generator>
+
+
+ This id generation strategy is specified in the mapping file as
+ <generator class="guid.comb" />
+
+ The
+ This code was contributed by Donald Mull. +
+
+ This id generation strategy is specified in the mapping file as
+ <generator class="guid" />
+
The built in strategies for identifier generation in NHibernate are:
+
+ This id generation strategy is specified in the mapping file as
+ <generator class="identity" />
+ or if the database natively supports identity columns
+ <generator class="native" />
+
+ This indicates to NHibernate that the database generates the id when + the entity is inserted. +
+
+ This id generation strategy is specified in the mapping file as
+
+ <generator class="sequence">
+ <param name="sequence">uid_sequence</param>
+ <param name="schema">db_schema</param>
+ </generator>
+
+
+ The
+ This id generation strategy is specified in the mapping file as
+
+ <generator class="seqhilo">
+ <param name="sequence">uid_sequence</param>
+ <param name="max_lo">max_lo_value</param>
+ <param name="schema">db_schema</param>
+ </generator>
+
+
+ The
+ The user may specify a
+ It is not intended that applications use this strategy directly. However,
+ it may be used to build other (efficient) strategies. The return type is
+
+ The hi value MUST be fetched in a separate transaction to the
+ The mapping parameters
+ This id generation strategy is specified in the mapping file as
+
+ <generator class="hilo">
+ <param name="table">table</param>
+ <param name="column">id_column</param>
+ <param name="max_lo">max_lo_value</param>
+ <param name="schema">db_schema</param>
+ <param name="catalog">db_catalog</param>
+ <param name="where">arbitrary additional where clause</param>
+ </generator>
+
+
+ The
+ The hi value MUST be fecthed in a separate transaction to the
+ This id generation strategy is specified in the mapping file as
+
+ <generator class="uuid.hex">
+ <param name="format">format_string</param>
+ <param name="separator">separator_string</param>
+ </generator>
+
+
+ The
+ The identifier string will consist of only hex digits. Optionally, the identifier string + may be generated with enclosing characters and separators between each component + of the UUID. If there are separators then the string length will be 36. If a format + that has enclosing brackets is used, then the string length will be 38. +
+
+
+
+ This class is based on
+ This id generation strategy is specified in the mapping file as
+ <generator class="uuid.string" />
+
+ <sql-query-name name="mySqlQuery">
+ <return alias="person" class="eg.Person" />
+ SELECT {person}.NAME AS {person.name}, {person}.AGE AS {person.age}, {person}.SEX AS {person.sex}
+ FROM PERSON {person} WHERE {person}.NAME LIKE 'Hiber%'
+ </sql-query-name>
+
+
+ SetParameter("foo", foo, NHibernateUtil.Int32);
+
+ A name may appear multiple times in the query string.
+ + Entities returned as results are initialized on demand. The first SQL query returns + identifiers only. +
+
+ This is a good strategy to use if you expect a high number of the objects
+ returned to be already loaded in the
+ Entities returned as results are initialized on demand. The first SQL query returns + identifiers only. +
+
+ This is a good strategy to use if you expect a high number of the objects
+ returned to be already loaded in the
+ IList<Cat> cats = session.QueryOver<Cat>()
+ .Where( c => c.Name == "Tigger" )
+ .And( c => c.Weight > minWeight ) )
+ .List();
+
+
+ using (ISession session = factory.OpenSession())
+ using (ITransaction tx = session.BeginTransaction())
+ {
+ try
+ {
+ // do some work
+ ...
+ tx.Commit();
+ }
+ catch (Exception e)
+ {
+ if (tx != null) tx.Rollback();
+ throw;
+ }
+ }
+
+ CAST(x AS INT)
which does not work in MSSQLSERVER, and possibly
+ other databases.
+
+ from p in db.Products
+ group p by p.Category.CategoryId
+ into g
+ select new
+ {
+ g.Key,
+ MaxPrice = g.Max(p => p.UnitPrice)
+ };
+
+ any
.
+ any
without meta-values.
+ case when ... then ... end as ...
+ decode(pkvalue, key1, 1, key2, 2, ..., 0)
+
+ public enum MyEnum
+ {
+ On,
+ Off,
+ Dimmed
+ }
+
+
+
+ public class MyEnumStringType : NHibernate.Type.EnumStringType
+ {
+ public MyEnumStringType()
+ : base( typeof( MyEnum ) )
+ {
+ }
+ }
+
+
+
+ ...
+ <property name="Status" type="MyEnumStringType, AssemblyContaining" />
+ ...
+
+
+
+ 2011-01-27T14:50:59.6220000Z
+
+ 'T'/'F'
to indicate true/false
.
+ 'Y'/'N'
to indicate true/false
.
+
+ configuration.Configure("path/to/hibernate.cfg.xml");
+
+
+ configure.TypeDefinition<TableHiLoGenerator>(c=>
+ {
+ c.Alias = "HighLow";
+ c.Properties = new {max_lo = 99};
+ });
+
+
+ IList<Cat> cats = session.QueryOver<Cat>()
+ .Where( c => c.Name == "Tigger" )
+ .And( c => c.Weight > minWeight ) )
+ .List();
+
+
+ If a value is passed in that is wrapped by
+ The value returned by the getter is not Quoted. To get the
+ column name in quoted form use
+ If a value is passed in that is wrapped by
+ The value returned by the getter is not Quoted. To get the
+ column name in quoted form use
+ This can store the length of the binary data that the
+ This is only needed by DataProviders (SqlClient) that need to specify a Size for the + DbParameter. Most DataProvider(Oralce) don't need to set the Size so a + BinarySqlType would work just fine. +
+
+ The
+ The
+ This can store the length of the binary data that the
+ This is only needed by DataProviders (SqlClient) that need to specify a Size for the + DbParameter. Most DataProvider(Oralce) don't need to set the Size so a + StringSqlType would work just fine. +
+
+ IList resultWithAliasedBean = s.CreateCriteria(typeof(Enrollment))
+ .CreateAlias("Student", "st")
+ .CreateAlias("Course", "co")
+ .SetProjection( Projections.ProjectionList()
+ .Add( Projections.Property("co.Description"), "CourseDescription")
+ )
+ .SetResultTransformer( new AliasToBeanResultTransformer(typeof(StudentDTO)))
+ .List();
+
+ StudentDTO dto = (StudentDTO)resultWithAliasedBean[0];
+
+
+ [BaseTypeRequired(typeof(IComponent)] // Specify requirement
+ public class ComponentAttribute : Attribute
+ {}
+
+ [Component] // ComponentAttribute requires implementing IComponent interface
+ public class MyComponent : IComponent
+ {}
+
+ Function definition table syntax:
+ ("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:
+
+
+ public static class EagerFetchingExtensionMethods
+ {
+ public static FluentFetchRequest<TOriginating, TRelated> FetchMany<TOriginating, TRelated> (
+ this IQueryable<TOriginating> query,
+ Expression<Func<TOriginating, IEnumerable<TRelated>>> relatedObjectSelector)
+ {
+
+ var methodInfo = ((MethodInfo) MethodBase.GetCurrentMethod ()).MakeGenericMethod (typeof (TOriginating), typeof (TRelated));
+ return CreateFluentFetchRequest<TOriginating, TRelated> (methodInfo, query, relatedObjectSelector);
+ }
+
+ private static FluentFetchRequest<TOriginating, TRelated> CreateFluentFetchRequest<TOriginating, TRelated> (
+ MethodInfo currentFetchMethod,
+ IQueryable<TOriginating> query,
+ LambdaExpression relatedObjectSelector)
+ {
+ var queryProvider = (QueryProviderBase) query.Provider;
+ var callExpression = Expression.Call (currentFetchMethod, query.Expression, relatedObjectSelector);
+ return new FluentFetchRequest<TOriginating, TRelated> (queryProvider, callExpression);
+ }
+ }
+
+ public class FluentFetchRequest<TQueried, TFetch> : QueryableBase<TQueried>
+ {
+ public FluentFetchRequest (IQueryProvider provider, Expression expression)
+ : base (provider, expression)
+ {
+ }
+ }
+
+ public IQueryParser CreateQueryParser ()
+ {
+ var customNodeTypeProvider = new MethodInfoBasedNodeTypeRegistry ();
+ customNodeTypeProvider.Register (new[] { typeof (EagerFetchingExtensionMethods).GetMethod ("FetchMany") }, typeof (FetchManyExpressionNode));
+
+ var nodeTypeProvider = ExpressionTreeParser.CreateDefaultNodeTypeProvider ();
+ nodeTypeProvider.InnerProviders.Insert (0, customNodeTypeProvider);
+
+ var transformerRegistry = ExpressionTransformerRegistry.CreateDefault ();
+ var processor = ExpressionTreeParser.CreateDefaultProcessor (transformerRegistry);
+ var expressionTreeParser = new ExpressionTreeParser (nodeTypeProvider, processor);
+
+ return new QueryParser (expressionTreeParser);
+ }
+
+
+ public static class EagerFetchingExtensionMethods
+ {
+ public static FluentFetchRequest<TOriginating, TRelated> FetchOne<TOriginating, TRelated> (
+ this IQueryable<TOriginating> query,
+ Expression<Func<TOriginating, TRelated>> relatedObjectSelector)
+ {
+
+ var methodInfo = ((MethodInfo) MethodBase.GetCurrentMethod ()).MakeGenericMethod (typeof (TOriginating), typeof (TRelated));
+ return CreateFluentFetchRequest<TOriginating, TRelated> (methodInfo, query, relatedObjectSelector);
+ }
+
+ private static FluentFetchRequest<TOriginating, TRelated> CreateFluentFetchRequest<TOriginating, TRelated> (
+ MethodInfo currentFetchMethod,
+ IQueryable<TOriginating> query,
+ LambdaExpression relatedObjectSelector)
+ {
+ var queryProvider = (QueryProviderBase) query.Provider;
+ var callExpression = Expression.Call (currentFetchMethod, query.Expression, relatedObjectSelector);
+ return new FluentFetchRequest<TOriginating, TRelated> (queryProvider, callExpression);
+ }
+ }
+
+ public class FluentFetchRequest<TQueried, TFetch> : QueryableBase<TQueried>
+ {
+ public FluentFetchRequest (IQueryProvider provider, Expression expression)
+ : base (provider, expression)
+ {
+ }
+ }
+
+ public IQueryParser CreateQueryParser ()
+ {
+ var customNodeTypeProvider = new MethodInfoBasedNodeTypeRegistry ();
+ customNodeTypeProvider.Register (new[] { typeof (EagerFetchingExtensionMethods).GetMethod ("FetchOne") }, typeof (FetchOneExpressionNode));
+
+ var nodeTypeProvider = ExpressionTreeParser.CreateDefaultNodeTypeProvider ();
+ nodeTypeProvider.InnerProviders.Insert (0, customNodeTypeProvider);
+
+ var transformerRegistry = ExpressionTransformerRegistry.CreateDefault ();
+ var processor = ExpressionTreeParser.CreateDefaultProcessor (transformerRegistry);
+ var expressionTreeParser = new ExpressionTreeParser (nodeTypeProvider, processor);
+
+ return new QueryParser (expressionTreeParser);
+ }
+
+
+ public static class EagerFetchingExtensionMethods
+ {
+ public static FluentFetchRequest<TQueried, TRelated> ThenFetchMany<TQueried, TFetch, TRelated> (
+ this FluentFetchRequest<TQueried, TFetch> query,
+ Expression<Func<TFetch, IEnumerable<TRelated>>> relatedObjectSelector)
+ {
+
+ var methodInfo = ((MethodInfo) MethodBase.GetCurrentMethod()).MakeGenericMethod (typeof (TQueried), typeof (TFetch), typeof (TRelated));
+ return CreateFluentFetchRequest<TQueried, TRelated> (methodInfo, query, relatedObjectSelector);
+ }
+
+ private static FluentFetchRequest<TOriginating, TRelated> CreateFluentFetchRequest<TOriginating, TRelated> (
+ MethodInfo currentFetchMethod,
+ IQueryable<TOriginating> query,
+ LambdaExpression relatedObjectSelector)
+ {
+ var queryProvider = (QueryProviderBase) query.Provider;
+ var callExpression = Expression.Call (currentFetchMethod, query.Expression, relatedObjectSelector);
+ return new FluentFetchRequest<TOriginating, TRelated> (queryProvider, callExpression);
+ }
+ }
+
+ public class FluentFetchRequest<TQueried, TFetch> : QueryableBase<TQueried>
+ {
+ public FluentFetchRequest (IQueryProvider provider, Expression expression)
+ : base (provider, expression)
+ {
+ }
+ }
+
+ public IQueryParser CreateQueryParser ()
+ {
+ var customNodeTypeProvider = new MethodInfoBasedNodeTypeRegistry ();
+ customNodeTypeProvider.Register (new[] { typeof (EagerFetchingExtensionMethods).GetMethod ("ThenFetchMany") }, typeof (ThenFetchManyExpressionNode));
+
+ var nodeTypeProvider = ExpressionTreeParser.CreateDefaultNodeTypeProvider ();
+ nodeTypeProvider.InnerProviders.Insert (0, customNodeTypeProvider);
+
+ var transformerRegistry = ExpressionTransformerRegistry.CreateDefault ();
+ var processor = ExpressionTreeParser.CreateDefaultProcessor (transformerRegistry);
+ var expressionTreeParser = new ExpressionTreeParser (nodeTypeProvider, processor);
+
+ return new QueryParser (expressionTreeParser);
+ }
+
+
+ public static class EagerFetchingExtensionMethods
+ {
+ public static FluentFetchRequest<TQueried, TRelated> ThenFetchOne<TQueried, TFetch, TRelated> (
+ this FluentFetchRequest<TQueried, TFetch> query,
+ Expression<Func<TFetch, TRelated>> relatedObjectSelector)
+ {
+
+ var methodInfo = ((MethodInfo) MethodBase.GetCurrentMethod()).MakeGenericMethod (typeof (TQueried), typeof (TFetch), typeof (TRelated));
+ return CreateFluentFetchRequest<TQueried, TRelated> (methodInfo, query, relatedObjectSelector);
+ }
+
+ private static FluentFetchRequest<TOriginating, TRelated> CreateFluentFetchRequest<TOriginating, TRelated> (
+ MethodInfo currentFetchMethod,
+ IQueryable<TOriginating> query,
+ LambdaExpression relatedObjectSelector)
+ {
+ var queryProvider = (QueryProviderBase) query.Provider;
+ var callExpression = Expression.Call (currentFetchMethod, query.Expression, relatedObjectSelector);
+ return new FluentFetchRequest<TOriginating, TRelated> (queryProvider, callExpression);
+ }
+ }
+
+ public class FluentFetchRequest<TQueried, TFetch> : QueryableBase<TQueried>
+ {
+ public FluentFetchRequest (IQueryProvider provider, Expression expression)
+ : base (provider, expression)
+ {
+ }
+ }
+
+ public IQueryParser CreateQueryParser ()
+ {
+ var customNodeTypeProvider = new MethodInfoBasedNodeTypeRegistry ();
+ customNodeTypeProvider.Register (new[] { typeof (EagerFetchingExtensionMethods).GetMethod ("ThenFetchOne") }, typeof (ThenFetchOneExpressionNode));
+
+ var nodeTypeProvider = ExpressionTreeParser.CreateDefaultNodeTypeProvider ();
+ nodeTypeProvider.InnerProviders.Insert (0, customNodeTypeProvider);
+
+ var transformerRegistry = ExpressionTransformerRegistry.CreateDefault ();
+ var processor = ExpressionTreeParser.CreateDefaultProcessor (transformerRegistry);
+ var expressionTreeParser = new ExpressionTreeParser (nodeTypeProvider, processor);
+
+ return new QueryParser (expressionTreeParser);
+ }
+
+
+ [BaseTypeRequired(typeof(IComponent)] // Specify requirement
+ public class ComponentAttribute : Attribute
+ {}
+
+ [Component] // ComponentAttribute requires implementing IComponent interface
+ public class MyComponent : IComponent
+ {}
+
+ Function definition table syntax:
+ ("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:
+
+
+ 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
+ join a in Addresses on s.AdressID equals a.ID
+ select new { s, a };
+
+
+ var result = (from s in Students
+ select s).Aggregate(0, (totalAge, s) => totalAge + s.Age);
+
+
+ var result = (from s in Students
+ select s.Name).Aggregate((allNames, name) => allNames + " " + name);
+
+
+ var result = (from s in Students
+ select s).All();
+
+
+ var result = (from s in Students
+ select s).Any();
+
+
+ var query = (from s in Students
+ select s).AsQueryable();
+
+
+ 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).Concat(students2);
+
+
+ var query = (from s in Students
+ select s).Contains (student);
+
+
+ var query = (from s in Students
+ select s).Count();
+
+
+ var query = (from s in Students
+ select s).DefaultIfEmpty ("student");
+
+
+ var query = (from s in Students
+ select s).Distinct();
+
+
+ var query = (from s in Students
+ select s).Except(students2);
+
+
+ var query = (from s in Students
+ select s).First();
+
+
+ var query = from s in Students
+ where s.First == "Hugo"
+ group s by s.Country;
+
+
+ var query = (from s in Students
+ select s).Intersect(students2);
+
+
+ var query = (from s in Students
+ select s).Last();
+
+
+ var query = (from s in Students
+ select s).LongCount();
+
+
+ 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.ID).OfType<int>();
+
+
+ var query = (from s in Students
+ select s).Reverse();
+
+
+ var query = (from s in Students
+ select s).Single();
+
+
+ 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).Take(3);
+
+
+ var query = (from s in Students
+ select s).Union(students2);
+
+
+ var query = from s in Students
+ where s.First == "Hugo"
+ select s;
+
+
+ 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 order in ...
+ select order.OrderItems.Count()
+
+ In this query, the
+ 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
+
+ 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
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
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
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