在上一个操作完成之前,在此上下文中开始第二个操作。任何实例成员都不能保证在web api中是线程安全的

时间:2017-10-06 08:17:04

标签: c#-4.0 asp.net-core-webapi

public ObservableCollection<Dictionary<string, object>> GetReceivepayment(string PaymentID)
{
        ObservableCollection<Dictionary<string, object>> detailcollection = new ObservableCollection<Dictionary<string, object>>();
        ObservableCollection<Dictionary<string, object>> invoicesandcreditsCollection = new ObservableCollection<Dictionary<string, object>>();
        Dictionary<string, object> detail;//= new Dictionary<string, object>();
        Dictionary<string, object> ReceivepaymentHeader;
        Dictionary<string, object> Receivepaymentlist;
        //string PaymentID = id;
        if (db == null)
            db = new BizSight_Sample_Product_CompanyContext();
        ReceivePayment _ReceivePaymentHeader = (from rec in db.ReceivePayment where rec.ReceivePaymentId == PaymentID.ToString() select rec).FirstOrDefault();
        Receivepaymentlist = new Dictionary<string, object>();
        ReceivepaymentHeader = new Dictionary<string, object>();
}

0 个答案:

没有答案