System.Data.Common.CommandTrees.ExpressionBuilder.DbExpressionBuilder.NewRow(System.Collections.Generic.IEnumerable)

Here are the examples of the csharp api class System.Data.Common.CommandTrees.ExpressionBuilder.DbExpressionBuilder.NewRow(System.Collections.Generic.IEnumerable) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

16 Examples 7

1. Example

Project: referencesource
Source File: Row.cs
View license
public DbNewInstanceExpression ToExpression()
        {
            return DbExpressionBuilder.NewRow(this.arguments);
        }

2. Example

Project: referencesource
Source File: CqlBlock.cs
View license
protected DbExpression GenerateProjectionCqt(DbExpression row, bool isTopLevel)
        {
            if (isTopLevel)
            {
                Debug.Assert(this.Slots.Where(slot => slot.IsRequiredByParent).Count() == 1, "Top level projection must project only one slot.");
                return this.Slots.Where(slot => slot.IsRequiredByParent).Single().AsCqt(row);
            }
            else
            {
                return DbExpressionBuilder.NewRow(
                    this.Slots.Where(slot => slot.IsRequiredByParent).Select(slot => new KeyValuePair<string, DbExpression>(slot.CqlFieldAlias, slot.AsCqt(row))));
            }
        }

3. Example

View license
private static DbExpression ResolveToExpression<TArgument>(TArgument argument)
        {
            object untypedArgument = argument;

            DbExpression constantResult;
            if (TryResolveToConstant(typeof(TArgument), untypedArgument, out constantResult))
            {
                return constantResult;
            }

            if (null == untypedArgument)
            {
                return (DbExpression)null;
            }

            // Direct DbExpression result
            if (typeof(DbExpression).IsAssignableFrom(typeof(TArgument)))
            {
                return (DbExpression)untypedArgument;
            }

            // Row
            if (typeof(Row).Equals(typeof(TArgument)))
            {
                return ((Row)untypedArgument).ToExpression();
            }

            // Conversion from anonymous type instance to DbNewInstanceExpression of a corresponding row type
            List<KeyValuePair<string, DbExpression>> columnValues;
            if (TryGetAnonymousTypeValues<TArgument, DbExpression>(untypedArgument, out columnValues))
            {
                return DbExpressionBuilder.NewRow(columnValues);
            }

            // The specified instance cannot be resolved to a DbExpression
            throw EntityUtil.NotSupported(Strings.Cqt_Factory_MethodResultTypeNotSupported(typeof(TArgument).FullName));
        }

4. Example

Project: referencesource
Source File: SemanticAnalyzer.cs
View license
private static DbExpression CreateProjectExpression(DbExpressionBinding source, AST.SelectClause selectClause, List<KeyValuePair<string, DbExpression>> projectionItems)
        {
            //
            // Create DbProjectExpression off the projectionItems.
            //
            DbExpression projectExpression;
            if (selectClause.SelectKind == AST.SelectKind.Value)
            {
                Debug.Assert(projectionItems.Count == 1, "projectionItems.Count must be 1 for SELECT VALUE");
                projectExpression = source.Project(projectionItems[0].Value);
            }
            else
            {
                projectExpression = source.Project(DbExpressionBuilder.NewRow(projectionItems));
            }

            //
            // Handle DISTINCT modifier - create DbDistinctExpression over the current projectExpression.
            //
            if (selectClause.DistinctKind == AST.DistinctKind.Distinct)
            {
                //
                // Ensure element type is equal-comparable.
                //
                ValidateDistinctProjection(projectExpression.ResultType, selectClause);

                //
                // Create distinct expression.
                //
                projectExpression = projectExpression.Distinct();
            }

            return projectExpression;
        }

5. Example

View license
internal static TypeUsage ValidateCreateRef(EntitySet entitySet, EntityType entityType, IEnumerable&/n ..... /n //View Source file for more details /n }

6. Example

View license
private DbExpression NormalizeAllSetSources(ExpressionConverter parent, DbExpression argumentExpr)
 /n ..... /n //View Source file for more details /n }

7. Example

View license
private DbExpressionBinding CapWithProject(DbExpressionBinding inputBinding, IList<DbPropertyExpr/n ..... /n //View Source file for more details /n }

8. Example

Project: referencesource
Source File: CTreeGenerator.cs
View license
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1309:UseOrdinalString/n ..... /n //View Source file for more details /n }

9. Example

Project: referencesource
Source File: CTreeGenerator.cs
View license
private RelOpInfo BuildEmptyProjection(Node relOpNode)
        {
            //
            // Ignor/n ..... /n //View Source file for more details /n }

10. Example

View license
private DbExpression RewriteEntity(DbExpression expression, EntityType entityType)
        {
       /n ..... /n //View Source file for more details /n }

11. Example

View license
private void FixupViewEntitySetDefiningQuery(EntitySet entitySet, MetadataWorkspace metadataWorkspac/n ..... /n //View Source file for more details /n }

12. Example

Project: referencesource
Source File: ObjectContext.cs
View license
private int BatchRefreshEntitiesByKey(RefreshMode refreshMode, Dictionary<EntityKey, EntityEntry&/n ..... /n //View Source file for more details /n }

13. Example

Project: referencesource
Source File: UpdateCompiler.cs
View license
private IEnumerable<DbModificationClause> BuildSetClauses(DbExpressionBinding target, Propagat/n ..... /n //View Source file for more details /n }

14. Example

View license
internal GeneratedView GetGeneratedView(EntitySetBase extent, MetadataWorkspace workspace, StorageMa/n ..... /n //View Source file for more details /n }

15. Example

Project: referencesource
Source File: SemanticAnalyzer.cs
View license
private static DbExpressionBinding ProcessGroupByClause(DbExpressionBinding source, AST.QueryExpr qu/n ..... /n //View Source file for more details /n }

16. Example

View license
internal override CqtExpression Translate(ExpressionConverter parent, MethodCallExpression call)
   /n ..... /n //View Source file for more details /n }