locked
This MVC3 C# sample in VB.net please? RRS feed

  • Question

  • User705342985 posted
    MVC C# samle:

    public class UnicornsContext : DbContext 
     public UnicornsContext() : base("name=UnicornsCEDatabase") 
    }


    I have this:

    Public Class WebbhotellDBContext
    Inherits DbContext

    Public Property Webbhotells() As DbSet(Of Webbhotell)
    End Class

    But I do not know how to put the 

    : base("name=UnicornsCEDatabase") 
    thingy in my VB.net code??

    Sunday, February 5, 2012 4:39 PM

Answers

  • User705342985 posted

    I did find the answer:

    Public Class WebbhotellDBContext
    Inherits DbContext

    Public Sub New()
    MyBase.New("name=MySqlMembershipConnection")
    End Sub

    Public Property Webbhotells() As DbSet(Of Webbhotell)
    End Class

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, February 5, 2012 5:17 PM