/// <summary> /// Determines if a relationship property refers to a single entity (as opposed to a collection.) /// </summary> /// <param name="member"></param> /// <returns></returns> public virtual bool IsSingletonAssociation(MetaType type, MemberInfo member) { if (!this.IsAssociation(type, member)) return false; return (TypeExtensions.FindEnumerable(TypeHelper.GetMemberType(member)) == null); }
public DbTableExpression(DbTableAlias alias, MetaType type, string name) : base(DbExpressionType.Table, typeof(void), alias) { _type = type; _name = name; }
/// <summary> /// Get an expression that represents the insert operation for the specified instance. /// </summary> /// <param name="entity"></param> /// <param name="instance">The instance to insert.</param> /// <param name="selector">A lambda expression that computes a return value from the operation.</param> /// <returns></returns> public abstract Expression CreateInsertExpression(MetaType type, Expression instance, LambdaExpression selector);
/// <summary> /// Get an expression for a mapped property relative to a root expression. /// The root is either a TableExpression or an expression defining an entity instance. /// </summary> public abstract Expression CreateMemberExpression(Expression root, MetaType type, MemberInfo member);
/// <summary> /// Gets an expression that constructs an entity instance relative to a root. /// The root is most often a TableExpression, but may be any other experssion such as /// a ConstantExpression. /// </summary> public abstract DbEntityExpression CreateEntityExpression(Expression root, MetaType type);
/// <summary> /// Get a query expression that selects all entities from a table /// </summary> /// <param name="rowType"></param> /// <returns></returns> public abstract DbProjectionExpression CreateProjection(MetaType type);
/// <summary> /// Determines if a property is mapped as a relationship /// </summary> public abstract bool IsAssociation(MetaType type, MemberInfo member);
/// <summary> /// Get an expression that represents the delete /// operation for the specified instance. /// </summary> public abstract Expression CreateDeleteExpression(MetaType type, Expression instance, LambdaExpression deleteCheck);
/// <summary> /// Get an expression that represents the delete /// operation for the specified instance. /// </summary> public abstract Expression CreateDeleteExpression(MetaType type, Expression instance, LambdaExpression deleteCheck);
/// <summary> /// Get an expression that represents the insert operation for the specified instance. /// </summary> /// <param name="entity"></param> /// <param name="instance">The instance to insert.</param> /// <param name="selector">A lambda expression that computes a return value from the operation.</param> /// <returns></returns> public abstract Expression CreateInsertExpression(MetaType type, Expression instance, LambdaExpression selector);
/// <summary> /// Get an expression for a mapped property relative to a root expression. /// The root is either a TableExpression or an expression defining an entity instance. /// </summary> public abstract Expression CreateMemberExpression(Expression root, MetaType type, MemberInfo member);
/// <summary> /// Gets an expression that constructs an entity instance relative to a root. /// The root is most often a TableExpression, but may be any other experssion such as /// a ConstantExpression. /// </summary> public abstract DbEntityExpression CreateEntityExpression(Expression root, MetaType type);
/// <summary> /// Get a query expression that selects all entities from a table /// </summary> /// <param name="rowType"></param> /// <returns></returns> public abstract DbProjectionExpression CreateProjection(MetaType type);
/// <summary> /// Determines if a property is mapped as a relationship /// </summary> public abstract bool IsAssociation(MetaType type, MemberInfo member);
public DbEntityExpression(MetaType entity, Expression expression) : base(DbExpressionType.Entity, expression.Type) { _entity = entity; _expression = expression; }
/// <summary> /// Get an expression that represents the update operation for the specified instance. /// </summary> public abstract Expression CreateUpdateExpression(MetaType type, Expression instance, LambdaExpression updateCheck, LambdaExpression selector, Expression @else);
/// <summary> /// Get an expression that represents the update operation for the specified instance. /// </summary> public abstract Expression CreateUpdateExpression(MetaType type, Expression instance, LambdaExpression updateCheck, LambdaExpression selector, Expression @else);