C# 클래스 JPB.DataAccess.Helper.LocalDb.LocalDbManager

파일 보기 프로젝트 열기: JPVenson/DataAccess 1 사용 예제들

Private Properties

프로퍼티 타입 설명
AddMapping void
AddTable void
GetMappings IEnumerable
LocalDbManager System
OnSetupDone void

공개 메소드들

메소드 설명
Alter ( ) : EditDatabaseScope

allowes to Add or remove tabels from this Database. If you try to use the tables before calling dispose on the returned Scope an InvalidOperationException will be thrown

GetSerializableContent ( ) : DataContent

Creates a new Class that supportes the IXmlSerializable interface. It is linked to this database and can be used to read or write all content in this database. To Write all elements using (var memStream = new MemoryStream()) { new XmlSerializer(typeof(DataContent)).Serialize(memStream, LocalDbManager.Scope.GetSerializableContent()); var xml = Encoding.ASCII.GetString(memStream.ToArray()); } When reading the data the database creation has to be in progress. You must execute the statement inside the DatabaseScope you want to fill using (new DatabaseScope()) { //Table creation ... //new LocalDbReposetory<T>(new DbConfig()) using (var memStream = new MemoryStream(Encoding.ASCII.GetBytes("xml"))) { new XmlSerializer(typeof(DataContent)).Deserialize(memStream); } }

비공개 메소드들

메소드 설명
AddMapping ( Type source, Type target ) : void
AddTable ( ILocalDbReposetoryBaseInternalUsage repro ) : void
GetMappings ( Type thisType ) : IEnumerable
LocalDbManager ( ) : System
OnSetupDone ( ) : void

메소드 상세

Alter() 공개 메소드

allowes to Add or remove tabels from this Database. If you try to use the tables before calling dispose on the returned Scope an InvalidOperationException will be thrown
public Alter ( ) : EditDatabaseScope
리턴 EditDatabaseScope

GetSerializableContent() 공개 메소드

Creates a new Class that supportes the IXmlSerializable interface. It is linked to this database and can be used to read or write all content in this database. To Write all elements using (var memStream = new MemoryStream()) { new XmlSerializer(typeof(DataContent)).Serialize(memStream, LocalDbManager.Scope.GetSerializableContent()); var xml = Encoding.ASCII.GetString(memStream.ToArray()); } When reading the data the database creation has to be in progress. You must execute the statement inside the DatabaseScope you want to fill using (new DatabaseScope()) { //Table creation ... //new LocalDbReposetory<T>(new DbConfig()) using (var memStream = new MemoryStream(Encoding.ASCII.GetBytes("xml"))) { new XmlSerializer(typeof(DataContent)).Deserialize(memStream); } }
public GetSerializableContent ( ) : DataContent
리턴 DataContent