zoukankan      html  css  js  c++  java
  • 调用存储过程返回复杂类型

    好久的问题了,被Microsoft 误导了一回,总算搞定了

    [Silverlight 4]+[Domainservice]

    1,建立好实体框架模型EDM,单击Get Column Information生成新的复杂类型

    2,在Your metadata 文件增加复杂类型的定义
    <MetadataTypeAttribute(GetType(TestSP_Result.TestSP_ResultMetadata))> _
    Partial Public Class TestSP_Result
        Friend NotInheritable Class TestSP_ResultMetadata
            Private Sub New()
                MyBase.New()
            End Sub

            Public Property address As String

            Public Property age As Nullable(Of Integer)

            Public Property [Class] As String

            <Key()>
            Public Property Name As String

            Public Property Score As Nullable(Of Decimal)

            Public Property Gender As String

            Public Property [Sum] As Nullable(Of Decimal)
        End Class

    End Class

    3,在your domainservice 文件增加调用方法
    #Region "SP"
        Public Function GetTestSP(ByVal gender As String, ByVal address As String) As ObjectResult(Of TestSP_Result)
            Return Me.ObjectContext.TestSP_Fun(gender, address)
        End Function
    #End Region

    4,打完收工。。。

    由于不知道的原因,需要我们手工去增加一些代码,,,后来的,,,可要注意了

  • 相关阅读:
    Docsify 如何在一个 MD 文件中嵌入另外一个文件
    集合与条件、循环语句
    字典(当索引不好用时)
    序列(列表、元组、字符串)
    变量、数据类型和运算符
    Python基础知识
    计算机基础知识
    Windows环境下Python2和Python3的安装
    操作系统基础
    计算机硬件基础知识
  • 原文地址:https://www.cnblogs.com/youfan/p/2009517.html
Copyright © 2011-2022 走看看