天天看點

工作中遇到的問題總結1

問題(1):

LINQ To Object 注意區分大小寫。

        var caseRefundList = entity.UP_refund_Info_CaseAPIRefund_GetList(accountName.ToLower()).Select(m => new

                        {

                            id = m.CaseID,

                            type = m.CaseType,

                            refund_id = m.id,

                            account_id = m.account_id

                        });

上述用于UP_refund_Info_CaseAPIRefund_GetList是一個存儲過程。

LINQ To SQL 是不區分大小寫。

       var result = entityCSOS_NEW_2.Cases.Where(m => m.CaseId == modelPaypal.CaseID.ToInt()

                                                              && m.Name == modelPaypal.Name

                                                              && m.CaseAmount == modelPaypal.RefundPrice

                                                              && m.CaseCurrency == modelPaypal.RefundCurrency

                                                            ).FirstOrDefault();

上述Cases是一個dbml檔案中的表

問題(2):對象經過謹慎遠端調用後,傳回的是一個新的對象副本,而不再指向原來的對象。