static public ApplicationLog Insert(ApplicationLog entity) { using (var update = PersistentStoreRegistry.GetDefaultStore().OpenUpdateContext(UpdateContextSyncMode.Flush)) { ApplicationLog newEntity = Insert(update, entity); update.Commit(); return newEntity; } }
static public ApplicationLog Insert(IUpdateContext update, ApplicationLog entity) { var broker = update.GetBroker<IApplicationLogEntityBroker>(); var updateColumns = new ApplicationLogUpdateColumns(); updateColumns.Host = entity.Host; updateColumns.Timestamp = entity.Timestamp; updateColumns.LogLevel = entity.LogLevel; updateColumns.Thread = entity.Thread; updateColumns.Message = entity.Message; updateColumns.Exception = entity.Exception; ApplicationLog newEntity = broker.Insert(updateColumns); return newEntity; }