又番的自留地

偷菜不如偷师

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

好久的问题了,被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,打完收工。。。

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

posted on 2011-04-08 15:30  Kyle.cj  阅读(963)  评论(0编辑  收藏  举报