CSLA .NET

Vibrant discussion about CSLA .NET and using the framework to build great business applications.

Forum has moved

New location: CSLA .NET forum


CSLA .NET Resources:
  • CSLA .NET forum
  • CSLA .NET home page
  • vb.net syntax for CSLA 4.3.12

    rated by 0 users
    Answered (Not Verified) This post has 0 verified answers | 3 Replies | 0 Followers

    Top 50 Contributor
    139 Posts
    Stefanus posted on Fri, Jun 5 2015 1:47 AM

    Hi all ,

    currently i used csla ver 4.3.12 in c#. but recently I got a small project which need vb.net as language

    so, i need a easy migration from my c# syntax into vb.net ?

     

    could anyone give a suggestion ?

    public static readonly PropertyInfo<string> InvNoProperty =
                RegisterProperty<string>(t => t.InvoiceNo);
            public string InvoiceNo
            {
                get { return GetProperty(InvNoProperty); }
                private set { LoadProperty(InvNoProperty, value); }
            }

    into a vb.net ????

     

    thanks

    stefanus

     

    All Replies

    Top 10 Contributor
    4,106 Posts
    Answered (Not Verified) Andy replied on Fri, Jun 5 2015 7:17 AM
    Suggested by Andy

    Well plugging that into a converter I get this:

    Dim InvNoProperty As PropertyInfo(Of StringRegisterProperty(() => {  }, t.InvoiceNo)

        
        
    Public Property InvoiceNo As String
            Get
                Return 
    GetProperty(InvNoProperty)
            
    End Get
            Set
                
    LoadProperty(InvNoProperty, value)
            
    End Set
        End Property

    But off the top of my head the PropertyInfo doesn't look to have had the static parsed correctly (Shared in Vb.net I think?).  Or the readonly, which I don't know if vb.net supports.  I used http://www.carlosag.net/Tools/CodeTranslator/ which should be a starting point, there may be other changes you need to do, so don't just run code through the converter and think you're done.

    Top 500 Contributor
    33 Posts

    The telerik converter is very accurate:

    Public Shared ReadOnly InvNoProperty As PropertyInfo(Of String) = RegisterProperty(Of String)(Function(t) t.InvoiceNo)
    Public Property InvoiceNo() As String
        Get
            Return GetProperty(InvNoProperty)
        End Get
        Private Set
            LoadProperty(InvNoProperty, value)
        End Set
    End Property

    http://converter.telerik.com/

     

    Top 50 Contributor
    139 Posts

    thanks andy & wilfreds

    could i ask another ?

    Private Overrides Sub DataPortal_Fetch(orderno As String)

     

    End Sub

    I don't know why this code failed to replace my C# code

     

    private void DataPortal_Fetch(string orderno)

    {

     

    }

     

    thanks

    Page 1 of 1 (4 items) | RSS

    Copyright (c) 2006-2014 Marimer LLC. All rights reserved.
    Email admin@lhotka.net for support.
    Powered by Community Server (Non-Commercial Edition), by Telligent Systems