ASP.NET MVC And LINQ General Questions

后端 未结 2 1805
说谎
说谎 2020-12-08 03:32

I\'ve asked a few questions on this topic before. Before we\'re able to implement either MVC or LINQ at work we need to resolve a few issues.

Multiple Recor

2条回答
  •  [愿得一人]
    2020-12-08 03:51

    Multiple Record Sets in ASP.NET MVC:

    If you have stored procedure that return A and B. Then you create a specific ViewModel:

    public class AB
    {
      public A DataA { get; set; };
      public B DataB { get; set; };
    }
    

    You can also use the ViewData dictionary instead of the Model property (or in combination with this property which also works)

    Strongly Typed Stored Procedure Output

    You create a specific class for the results returning from the stored procedure with custom fields.

    LINQ Column Lookups

    Not 100% sure about this, but LINQ lookups the column field names and parameter names from a stored procedure at design time.

提交回复
热议问题