久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

  • <tfoot id='zyoP1'></tfoot>
    <i id='zyoP1'><tr id='zyoP1'><dt id='zyoP1'><q id='zyoP1'><span id='zyoP1'><b id='zyoP1'><form id='zyoP1'><ins id='zyoP1'></ins><ul id='zyoP1'></ul><sub id='zyoP1'></sub></form><legend id='zyoP1'></legend><bdo id='zyoP1'><pre id='zyoP1'><center id='zyoP1'></center></pre></bdo></b><th id='zyoP1'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='zyoP1'><tfoot id='zyoP1'></tfoot><dl id='zyoP1'><fieldset id='zyoP1'></fieldset></dl></div>

      <small id='zyoP1'></small><noframes id='zyoP1'>

        <bdo id='zyoP1'></bdo><ul id='zyoP1'></ul>
      <legend id='zyoP1'><style id='zyoP1'><dir id='zyoP1'><q id='zyoP1'></q></dir></style></legend>

      1. 使用 Angular 2 在 Asp.net MVC 中檢測到自引用循環

        Self referencing loop Detected for property in Asp.net MVC with Angular 2(使用 Angular 2 在 Asp.net MVC 中檢測到自引用循環)
        <i id='BcQOn'><tr id='BcQOn'><dt id='BcQOn'><q id='BcQOn'><span id='BcQOn'><b id='BcQOn'><form id='BcQOn'><ins id='BcQOn'></ins><ul id='BcQOn'></ul><sub id='BcQOn'></sub></form><legend id='BcQOn'></legend><bdo id='BcQOn'><pre id='BcQOn'><center id='BcQOn'></center></pre></bdo></b><th id='BcQOn'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='BcQOn'><tfoot id='BcQOn'></tfoot><dl id='BcQOn'><fieldset id='BcQOn'></fieldset></dl></div>
          <bdo id='BcQOn'></bdo><ul id='BcQOn'></ul>
            <tbody id='BcQOn'></tbody>
          <tfoot id='BcQOn'></tfoot>
        • <small id='BcQOn'></small><noframes id='BcQOn'>

            • <legend id='BcQOn'><style id='BcQOn'><dir id='BcQOn'><q id='BcQOn'></q></dir></style></legend>
                1. 本文介紹了使用 Angular 2 在 Asp.net MVC 中檢測到自引用循環的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  1. 我創建了一個數據庫,因為我有多個表之間存在關系.
                  2. 嘗試從我的 WEB 應用程序獲取數據時出現此錯誤<塊引用>

                    "'檢測到類型為 'System.Data.Entity.DynamicProxies.PrescriptionMaster_2C4C63F6E22DFF8E29DCAC8D06EBAE038831B58747056064834E80E41B5C4E4A'的自引用循環.PathMaster'[pPrescription]

                  3. 我不明白為什么我會收到這個錯誤,當我刪除表之間的關系時,我從中獲得了正確的數據.
                  4. 我嘗試了其他解決方案,例如添加

                    "config.Formatters.JsonFormatter.SerializerSettings.ReferenceLoopHandling= Newtonsoft.Json.ReferenceLoopHandling.Ignore;"

                    在 Webconfig.cs 中,但對我沒有任何作用.

                  請幫幫我,我該怎么辦?

                  解決方案

                  防止這種情況發生的唯一正確方法是不發送實體框架對象(可能包含此類循環)進入 JSON 序列化器(不太擅長知道何時停止序列化).

                  相反,創建模擬前端實際需要的 EF 對象部分的 ViewModel,然后使用 EF 對象填充這些 ViewModel.

                  一種快速而骯臟的方法是只使用匿名對象,例如:

                  返回新的{產品 = 新{Id = EF_Product.Id,名稱 = EF_Product.Name}};

                  一個好的經驗法則是僅將 EF 對象中的簡單屬性(數字、布爾值、字符串、日期時間)分配給 ViewModel 項.一旦遇到作為另一個 EF 對象(或 EF 對象的集合)的 EF 對象屬性,那么您也需要將它們轉換為未鏈接到 EF 的簡單"對象.

                  另一方面,還有諸如 AutoMapper 之類的庫.如果您決定需要實際的 ViewModel 類,那么 AutoMapper 將幫助以非常結構化的方式將 EF 對象映射到這些 ViewModel.

                  1. I Have Create a DB in that I am Having Multiple tables having Relationship between them.
                  2. When a try to get data from my WEb app i get this error

                    "'Self referencing loop detected with type 'System.Data.Entity.DynamicProxies.PrescriptionMaster_2C4C63F6E22DFF8E29DCAC8D06EBAE038831B58747056064834E80E41B5C4E4A'. Path '[0].Patient.PrescriptionMasters"

                  3. I coudn't get why i am getting this error, and when i remove the relationships between tables i get proper data From it.
                  4. I have Tried other solutions like adding

                    "config.Formatters.JsonFormatter.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore; "

                    in Webconfig.cs but nothing has worked for me.

                  Please help me, what should I do ?

                  解決方案

                  The only proper way to prevent this from happening is by not sending Entity Framework objects (which may contain such loops) into the JSON Serializer (which is not too good at knowing when to stop serializing).

                  Instead, create ViewModels that mimic the parts of the EF Objects that your Front End actually needs, then fill those ViewModels using the EF Objects.

                  A quick-and-dirty way is to just use anonymous objects, for example:

                  return new
                  {
                      Product = new
                      {
                          Id = EF_Product.Id,
                          Name = EF_Product.Name
                      }
                  };
                  

                  A good rule-of-thumb is to only assign simple properties (number, bool, string, datetime) from the EF Objects to the ViewModel items. As soon as you encounter an EF Object property that is yet another EF Object (or a collection of EF Objects), then you need to translate those as well to 'simple' objects that are not linked to EF.

                  On the other end of the spectrum there are libraries such as AutoMapper. If you decide that you need actual ViewModel classes, then AutoMapper will help mapping the EF Objects to those ViewModels in a very structured way.

                  這篇關于使用 Angular 2 在 Asp.net MVC 中檢測到自引用循環的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Can I figure out a list of databases and the space used by SQL Server instances without writing SQL queries?(我可以在不編寫 SQL 查詢的情況下找出數據庫列表和 SQL Server 實例使用的空間嗎?) - IT屋-程序員軟件開發
                  How to create a login to a SQL Server instance?(如何創建對 SQL Server 實例的登錄?)
                  How to know the version and edition of SQL Server through registry search(如何通過注冊表搜索知道SQL Server的版本和版本)
                  Why do I get a quot;data type conversion errorquot; with ExecuteNonQuery()?(為什么會出現“數據類型轉換錯誤?使用 ExecuteNonQuery()?)
                  How to show an image from a DataGridView to a PictureBox?(如何將 DataGridView 中的圖像顯示到 PictureBox?)
                  WinForms application design - moving documents from SQL Server to file storage(WinForms 應用程序設計——將文檔從 SQL Server 移動到文件存儲)
                    <tbody id='kvWV8'></tbody>

                    <bdo id='kvWV8'></bdo><ul id='kvWV8'></ul>
                  • <i id='kvWV8'><tr id='kvWV8'><dt id='kvWV8'><q id='kvWV8'><span id='kvWV8'><b id='kvWV8'><form id='kvWV8'><ins id='kvWV8'></ins><ul id='kvWV8'></ul><sub id='kvWV8'></sub></form><legend id='kvWV8'></legend><bdo id='kvWV8'><pre id='kvWV8'><center id='kvWV8'></center></pre></bdo></b><th id='kvWV8'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='kvWV8'><tfoot id='kvWV8'></tfoot><dl id='kvWV8'><fieldset id='kvWV8'></fieldset></dl></div>

                          <small id='kvWV8'></small><noframes id='kvWV8'>

                          • <legend id='kvWV8'><style id='kvWV8'><dir id='kvWV8'><q id='kvWV8'></q></dir></style></legend>
                            <tfoot id='kvWV8'></tfoot>

                            主站蜘蛛池模板: 亚洲人成人一区二区在线观看 | 国产探花在线精品一区二区 | 久国久产久精永久网页 | 九九福利 | 99re在线视频免费观看 | 天堂中文资源在线 | 九九色综合| 九九九视频在线观看 | 欧美日韩精品久久久免费观看 | 久久爱一区 | 国产精品一区二区三区四区 | 一区二区三区在线 | 欧美精品a∨在线观看不卡 欧美日韩中文字幕在线播放 | 毛片免费视频 | 久久噜噜噜精品国产亚洲综合 | av网站观看| 亚洲综合国产精品 | 青娱乐一区二区 | 欧美亚洲视频 | 国产91丝袜在线18 | 精品一区二区三区av | 中国大陆高清aⅴ毛片 | 国产精品美女久久久久aⅴ国产馆 | 亚洲精品一区在线观看 | 一区二区三区小视频 | 国产第一区二区 | 黄色毛片在线观看 | 午夜免费| 91精品久久久久久久久99蜜臂 | 日日骚av| 亚洲网在线 | 久久一区二区精品 | 国产精品99久久久久久宅男 | 二区三区av| 欧美亚洲一级 | 男人久久天堂 | 亚洲综合天堂网 | 一级免费a | 日韩欧美中文在线 | 99re在线视频观看 | www.亚洲成人网|