Last change
on this file since 3578 was
3578,
checked in by kgrading, 14 years ago
|
Removed References to HiveLogging and updated the default logging mechanism (#991)
|
File size:
962 bytes
|
Rev | Line | |
---|
[2904] | 1 | using System;
|
---|
| 2 | using System.Collections.Generic;
|
---|
| 3 | using System.Linq;
|
---|
| 4 | using System.Text;
|
---|
[3578] | 5 | using System.Data.Linq;
|
---|
| 6 | using HeuristicLab.Tracing;
|
---|
[2904] | 7 |
|
---|
| 8 | namespace HeuristicLab.Hive.Server.LINQDataAccess {
|
---|
[3011] | 9 | public abstract class BaseDao<TBusiness, TDatabaseEntity> {
|
---|
[2904] | 10 | public static HiveDataContext Context {
|
---|
| 11 | get {
|
---|
| 12 | return ContextFactory.Context;
|
---|
| 13 | }
|
---|
| 14 | }
|
---|
[3011] | 15 |
|
---|
[3578] | 16 | protected void CommitChanges() {
|
---|
| 17 | try {
|
---|
| 18 | Context.SubmitChanges(ConflictMode.ContinueOnConflict);
|
---|
| 19 | } catch (ChangeConflictException e) {
|
---|
| 20 | Logger.Warn("Concurrency Exception! " + e.Message);
|
---|
| 21 | foreach (ObjectChangeConflict conflict in Context.ChangeConflicts) {
|
---|
| 22 | conflict.Resolve(RefreshMode.KeepChanges);
|
---|
| 23 | }
|
---|
| 24 | }
|
---|
| 25 | }
|
---|
| 26 |
|
---|
[3011] | 27 | public abstract TDatabaseEntity DtoToEntity(TBusiness source, TDatabaseEntity target);
|
---|
| 28 | public abstract TBusiness EntityToDto(TDatabaseEntity source, TBusiness target);
|
---|
| 29 |
|
---|
[2904] | 30 | }
|
---|
| 31 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.