Datei: NDODLL.Tests/QueryTests/NDOFactory.cs
Last Commit (e0dce83)
			
| 1 | using System; | 
| 2 | using System.IO; | 
| 3 | using DataTypeTestClasses; | 
| 4 | using NDO; | 
| 5 | using NDO.Mapping; | 
| 6 | |
| 7 | namespace QueryTests | 
| 8 | { | 
| 9 | ····class NDOFactory | 
| 10 | ····{ | 
| 11 | ········static object lockObject = new object(); | 
| 12 | ········static NDOFactory instance; | 
| 13 | ········static NDOMapping mapping; | 
| 14 | |
| 15 | ········static NDOFactory() | 
| 16 | ········{ | 
| 17 | ············instance = new NDOFactory(); | 
| 18 | ········} | 
| 19 | |
| 20 | ········public static NDOFactory Instance | 
| 21 | ········{ | 
| 22 | ············get { return instance; } | 
| 23 | ········} | 
| 24 | |
| 25 | ········public PersistenceManager PersistenceManager | 
| 26 | ········{ | 
| 27 | ············get | 
| 28 | ············{ | 
| 29 | ················PersistenceManager pm; | 
| 30 | ················lock (lockObject) | 
| 31 | ················{ | 
| 32 | ····················if (mapping == null) | 
| 33 | ····················{ | 
| 34 | ························pm = new PersistenceManager(); | 
| 35 | ························mapping = pm.NDOMapping; | 
| 36 | ····················} | 
| 37 | ····················else | 
| 38 | ····················{ | 
| 39 | pm = new PersistenceManager( mapping ) ; | 
| 40 | ····················} | 
| 41 | ················} | 
| 42 | ················// Setting an AccessorName to avoid changing the full chain of dependencies for PureBusinessClasses | 
| 43 | ················pm.NDOMapping.FindClass( typeof( DataContainerDerived ) ).FindField( "byteArrVar" ).AccessorName = "ByteArrVar"; | 
| 44 | ················return pm; | 
| 45 | ············} | 
| 46 | ········} | 
| 47 | ····} | 
| 48 | } | 
| 49 | 
New Commit (92dda21)
			
| 1 | using System; | 
| 2 | using System.IO; | 
| 3 | using DataTypeTestClasses; | 
| 4 | using NDO; | 
| 5 | using NDO.Mapping; | 
| 6 | |
| 7 | namespace QueryTests | 
| 8 | { | 
| 9 | ····class NDOFactory | 
| 10 | ····{ | 
| 11 | ········static object lockObject = new object(); | 
| 12 | ········static NDOFactory instance; | 
| 13 | ········static NDOMapping mapping; | 
| 14 | |
| 15 | ········static NDOFactory() | 
| 16 | ········{ | 
| 17 | ············instance = new NDOFactory(); | 
| 18 | ········} | 
| 19 | |
| 20 | ········public static NDOFactory Instance | 
| 21 | ········{ | 
| 22 | ············get { return instance; } | 
| 23 | ········} | 
| 24 | |
| 25 | ········public PersistenceManager PersistenceManager | 
| 26 | ········{ | 
| 27 | ············get | 
| 28 | ············{ | 
| 29 | ················PersistenceManager pm; | 
| 30 | ················lock (lockObject) | 
| 31 | ················{ | 
| 32 | ····················if (mapping == null) | 
| 33 | ····················{ | 
| 34 | ························pm = new PersistenceManager(); | 
| 35 | ························mapping = pm.NDOMapping; | 
| 36 | ····················} | 
| 37 | ····················else | 
| 38 | ····················{ | 
| 39 | pm = new PersistenceManager( mapping, null ) ; | 
| 40 | ····················} | 
| 41 | ················} | 
| 42 | ················// Setting an AccessorName to avoid changing the full chain of dependencies for PureBusinessClasses | 
| 43 | ················pm.NDOMapping.FindClass( typeof( DataContainerDerived ) ).FindField( "byteArrVar" ).AccessorName = "ByteArrVar"; | 
| 44 | ················return pm; | 
| 45 | ············} | 
| 46 | ········} | 
| 47 | ····} | 
| 48 | } | 
| 49 |