private SimpleQuery With(IEnumerable <object> args, WithType withType = WithType.NotSpecified) { var clauses = new List <SimpleQueryClauseBase>(_clauses); clauses.AddRange(args.OfType <ObjectReference>().Select(reference => new WithClause(reference, withType))); return(new SimpleQuery(this, clauses.ToArray())); }
protected static RelationType WithTypeToRelationType(WithType withType, RelationType defaultRelationType) { switch (withType) { case WithType.One: return(RelationType.ManyToOne); case WithType.Many: return(RelationType.OneToMany); default: return(defaultRelationType); } }
protected void btnWSave_Click(object sender, EventArgs e) { int dep = Convert.ToInt32(ddlWDep.SelectedValue); string name = tbWName.Text; using (ClubDBEntities club = new ClubDBEntities()) { WithType with = new WithType(); with.Department = dep; with.Name = name; club.WithTypes.AddObject(with); club.SaveChanges(); chagesSaved(); } }
public WithClause(ObjectReference objectReference, WithMode mode, WithType type) { _objectReference = objectReference; _mode = mode; _type = type; }
public WithClause(ObjectReference objectReference, WithType type) : this(objectReference, WithMode.NotSpecified, type) { }
private static RelationType WithTypeToRelationType(WithType withType, RelationType defaultRelationType) { switch (withType) { case WithType.One: return RelationType.ManyToOne; case WithType.Many: return RelationType.OneToMany; default: return defaultRelationType; } }