none
Entity Framework Generated Model.Designer.cs file is empty. RRS feed

  • Question

  • Hi All,

    I am using Entity Framework for a db project with SQL Server 2012. This SQL Server 2012 and VS 2013 both are installed on a local PC. The PC's operating system is Windows 7.

    I have created a SQL Server Database with 4 tables that has several relationships. Please refer the below screenshot.

    My DB creation is s successful. I have tried to add the DB to follow 'Entity Framework' in Visual Studio 2013. I have successfully added NuGet Package Manager and Entity Framework. 

    Once done that I have successfully add the database to the entity framework. Please refer the below screenshot.

    After this step the designer file(RestaurantPOSModel.edmx > RestaurantPOSModel.Designer.cs) got the below set of statements. Please refer the below screenshot.

    I can't understand the issue. Could you guys help me on this?

    Thanks and regards,
    Chiranthaka

    • Moved by 宝宝徐 Wednesday, September 20, 2017 6:29 AM
    Tuesday, September 19, 2017 5:58 PM

All replies

  • Hi Chiranthaka,

    Welcome to MSDN forum.

    This forum is to talk about visual studio IDE, I will move your thread to Data Platform Development >

    ADO.NET Entity Framework and LINQ to Entities  forum for professional support.

    Best regards,

    Joyce


    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, September 20, 2017 6:26 AM
  • Hi Chiranthaka J,

    Thank you for posting the problem here.

    For your Database, I have made a test. It is ok. What error did you get when you used the Database First pattern of the Entity Framework?

    >> After this step the designer file(RestaurantPOSModel.edmx > RestaurantPOSModel.Designer.cs) got the below set of statements. Please refer the below screenshot.                                                                                                                                                              

    I suppose that it just is description file. From its content, it just gives you some guidance information when you don’t use EF Database First. I suppose that you should pay attention to RestaurantPOSModel.Context.cs, Product.cs, ProductType.cd, Transaction.cs and TransactionItem.cs files. These files will be used when you executes insert/select/update/delete operations for your database.

    For RestaurantPOSModel.Context.cs, Product.cs, ProductType.cd, Transaction.cs and TransactionItem.cs files, the RestaurantPOSModel.Context.cs file contains a class that derives from the DbContext class, and provides a property for each model class that corresponds to a database table. The Product.cs, ProductType.cs, TransactionItem.cs, and Transaction.cs files contain the model classes that represent the databases tables. You will use both the context class and the model classes when working with scaffolding.

    I’m glad to be of help to you.

    Best Regards

    Bob


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, September 20, 2017 8:21 AM