我已經創建了一個通用的dll來存放常用的變量。我有用戶定義的字段是佔位符,因此我們可以保存客戶特定的數據。這個DLL將用於客戶端特定的應用程序。如何將通用變量用於客戶特定數據
如何將這些通用變量映射到相關的sql表字段,以便我們可以操作自定義數據庫?我想避免編寫自定義查詢。
這樣的ORM就像小巧玲瓏會有用嗎?
編輯:根據danihp的反應,我已經開始關注實體框架的工作。看起來很有希望。我推斷使用Fluent API我可以將這個dll移植到獨特的應用程序中,並傳遞一個db對象(而不是我的類)來執行業務邏輯。
Public Class Runs
Private _RunMailPeices As Dictionary(Of String, MailPiece) = New Dictionary(Of String, MailPiece)
Private _run As Integer
Private MailDate As DateTime
Public Property RunMailPeices As Dictionary(Of String, MailPiece)
Get
RunMailPeices = _RunMailPeices
End Get
Set(value As Dictionary(Of String, MailPiece))
_RunMailPeices = value
End Set
End Property
Public Property run As Integer
Get
run = _run
End Get
Set(value As Integer)
_run = value
End Set
End Property
End Class
和:
Public Class MailPiece
Private _address1 As String = String.Empty
Private _address2 As String = String.Empty
Private _string1 As String = String.Empty
Private _string2 As String = String.Empty
Public Property Address1 As String
Get
Address1 = _address1
End Get
Set(value As String)
_address1 = value
End Set
End Property
Public Property Address2 As String
Get
Address2 = _address2
End Get
Set(value As String)
_address2 = value
End Set
End Property
Public Property String1 As String
Get
String1 = _string1
End Get
Set(value As String)
_string1 = value
End Set
End Property
Public Property String2 As String
Get
String2 = _string2
End Get
Set(value As String)
_string2 = value
End Set
End Property
End Class
學習我猜你不平均淨仿製藥,因爲沒有什麼在與他們無關。看起來它會導致數據進出數據庫I/O的DLL的數據比保存的數據更多。 – Plutonix
這就是我想弄明白的。如果我能這樣做,我可以利用很多其他內部DLL。 – DavidTheDev