static public Staff Insert(Staff entity) { using (var update = PersistentStoreRegistry.GetDefaultStore().OpenUpdateContext(UpdateContextSyncMode.Flush)) { Staff newEntity = Insert(update, entity); update.Commit(); return newEntity; } }
static public Staff Insert(IUpdateContext update, Staff entity) { var broker = update.GetBroker<IStaffEntityBroker>(); var updateColumns = new StaffUpdateColumns(); updateColumns.ServerPartitionKey = entity.ServerPartitionKey; updateColumns.Identifier = entity.Identifier; updateColumns.Name = entity.Name; Staff newEntity = broker.Insert(updateColumns); return newEntity; }