Stored Proc in RIA Services

I want to download some data using SP.

I put the SP in Linq in an SQL class, and I don't know how to use it to load its data into a datagrid. In LinqToSqlDomainService, I cannot figure out how to call SP. What steps should I use.

Any samples of this? All samples use a table.

Thanks x

+3
source share
4 answers

-

http://betaforums.silverlight.net/forums/p/218383/521023.aspx

1) ADO -; ; .

2) . node, , . node, . "", .

3) , / . ( , SP ) , . SP , . SP , , Entity ( ) .

, " ", SP. , .

4) Domain Service -. DataModel, , DataContext . , . .

5) Complex Entity. manully SP : , SP SP1, Complex, , SP1_Result.

Domain Service :

public IQueryable<SP1_Result> SP1()
    {
        return this.ObjectContext.SP1().AsQueryable();            
    }

. ​​: "SP1_Result " ( - RIA Service SP1). , :

SP1_Result Key:

[MetadataTypeAttribute(typeof(SP1_Result.SP1_ResultMetadata))]
public partial class SP1_Result
{
    internal sealed class SP1_ResultMetadata
    {
        [Key]
        public int MyId;  // Change MyId to the ID field of your SP_Result
    }
} 

6) . SP1_Result, . , , SP1_Result Entity. DomainContext.SP1Query DomainContext.SP1_Results Silverlight. , (, ).

+2

. , DDS. ObservableCollection < > , DataContext , .

... if you do not want to use it in a Silverlight RIA application through a proxy generated by magic code, in this case your goose is prepared, unless the result lines exactly match one of the objects. If you can fulfill this criterion, edit the DomainService class and draw a method that wraps the ObjectContext method.

0
source

Source: https://habr.com/ru/post/1714957/


All Articles