存储库工厂 [英] Repository Factory

查看:63
本文介绍了存储库工厂的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于Visual Studio 2010,没有存储库工厂的发布。



可以为数据库表和业务实体等创建存储过程的东西。



< pre lang =sql> CREATE TABLE [dbo]。[FPCA_BalanceSheetDetails](

[BalanceSheetKey] [ int ] NOT NULL

[来源] [ nvarchar ]( 50 NOT NULL

[类型] [ nvarchar ]( 255 NULL

[实体] [ nvarchar ]( 50 NOT NULL

[Legal_entity] [ nvarchar ]( 50 NOT NULL

[帐户] [< span class =code-keyword> nvarchar ]( 50 NOT NULL

[日期] [ datetime ] NOT NULL

[货币] [ nvarchar ]( 255 NULL

[CCY_Value] [十进制]( 18 2 NULL

[值] [十进制](< span class =code-digit> 18 , 2 NULL

[评论] [ nvarchar ]( 250 NULL

ON [ PRIMARY ]

解决方案

那么你可能会喜欢这个工具:

Database Helper v 2.0.0 [ ^ ]



关于Database Helper的一个有趣的事情是它使用 SQL Server管理对象 [ ^ ]来分析数据库架构。



或者你可以使用实体框架。



问候

Espen Harlinn


您可以自己编写,也可以使用EF4,也可以购买或下载开源软件。 代码项目中有很多生成器示例[ ^ ]或在Google上搜索。


 私有  Sub  btn_MIReports_Click()

Dim temp_val 作为 变体

temp_val = txt_MIReport.Value
txt_MIReport.Value = Get_folder( 选择MI报告的导出文件夹

如果 txt_MIReport.Value = 然后
txt_MIReport.Value = temp_val
结束 如果

结束 Sub

Public 功能 Get_folder(title_txt 作为 字符串作为 字符串

' 此函数获取文件夹名称并将其返回给调用子

Dim folder_name As String
Dim dlgOpen As FileDialog

Set dlgOpen = Application.FileDialog (msoFileDialogFolderPicker)
使用 dlgOpen
。标题= title_txt
如果.Show = -1 然后
folder_name = .SelectedItems( 1 )& \
其他

结束 如果
结束 使用

设置 dlgOpen = Nothing

Get_folder = folder_name

结束 功能


for Visual Studio 2010 there is no release of repository factory.

something that can create the stored procedures for the database tables and the business entities etc.

CREATE TABLE [dbo].[FPCA_BalanceSheetDetails](

        [BalanceSheetKey] [int] NOT NULL,

        [Source] [nvarchar](50) NOT NULL,

        [Type] [nvarchar](255) NULL,

        [Entity] [nvarchar](50) NOT NULL,

        [Legal_entity] [nvarchar](50) NOT NULL,

        [Account] [nvarchar](50) NOT NULL,

        [Date] [datetime] NOT NULL,

        [Currency] [nvarchar](255) NULL,

        [CCY_Value] [decimal](18, 2) NULL,

        [Value] [decimal](18, 2) NULL,

        [Comments] [nvarchar](250) NULL

) ON [PRIMARY]

解决方案

Then you''ll probably love this tool:
Database Helper v 2.0.0[^]

one interesting thing about Database Helper is that it uses SQL Server Management Objects[^] to analyze the database schema.

or you can use the entity framework.

Regards
Espen Harlinn


You could write your own or you could use EF4 or you could buy one or download an open source one. there are plenty of examples of generators on Code Project[^] or search on Google.


Private Sub btn_MIReports_Click()

Dim temp_val As Variant

temp_val = txt_MIReport.Value
txt_MIReport.Value = Get_folder("Select the export folder for MI reports")

If txt_MIReport.Value = "" Then
    txt_MIReport.Value = temp_val
End If

End Sub

Public Function Get_folder(title_txt As String) As String

'This function gets the folder name and returns it to the calling sub

Dim folder_name As String
Dim dlgOpen As FileDialog

    Set dlgOpen = Application.FileDialog(msoFileDialogFolderPicker)
        With dlgOpen
            .Title = title_txt
            If .Show = -1 Then
                folder_name = .SelectedItems(1) & "\"
            Else
            
            End If
        End With
    
    Set dlgOpen = Nothing

    Get_folder = folder_name

End Function


这篇关于存储库工厂的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆