天天看点

工作中遇到的问题总结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):对象经过谨慎远程调用后,返回的是一个新的对象副本,而不再指向原来的对象。