{"id":371430,"date":"2024-05-21T04:48:45","date_gmt":"2024-05-21T04:48:45","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=371430"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=371430","title":{"rendered":"<span>\u041d\u0435\u043f\u043e\u0431\u0435\u0434\u0438\u043c\u044b\u0439 null: \u043a\u043e\u043f\u0430\u0435\u043c\u0441\u044f \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c \u043a\u043e\u0434\u0435 nopCommerce<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>nopCommerce \u2014 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u0430\u044f \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u043c\u0430\u0433\u0430\u0437\u0438\u043d\u043e\u0432 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u0430\u044f \u043d\u0430 \u0431\u0430\u0437\u0435 ASP.NET Core. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u0443\u0437\u043d\u0430\u0435\u043c, \u043a\u0430\u043a\u0438\u0435 \u043d\u0435\u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u044b\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b \u0442\u0430\u044f\u0442\u0441\u044f \u0432 \u043a\u043e\u0434\u0435 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/428\/a26\/c0f\/428a26c0f7f31c8300c9a7b39031084f.png\" width=\"1600\" height=\"902\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/428\/a26\/c0f\/428a26c0f7f31c8300c9a7b39031084f.png\"\/><\/figure>\n<h3>\u041f\u0430\u0440\u0430 \u0441\u043b\u043e\u0432 \u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0435<\/h3>\n<p>\u041f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u041f\u041e \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u043e\u0434\u0430 \u0438\u0433\u0440\u0430\u0435\u0442 \u0440\u0435\u0448\u0430\u044e\u0449\u0443\u044e \u0440\u043e\u043b\u044c \u0432 \u043d\u0430\u0434\u0451\u0436\u043d\u043e\u0441\u0442\u0438, \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0445 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432.<\/p>\n<p>nopCommerce \u2014 \u043e\u0442\u043a\u0440\u044b\u0442\u0430\u044f \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u043e\u0439 \u043a\u043e\u043c\u043c\u0435\u0440\u0446\u0438\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 ASP.NET Core. \u041e\u043d\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u0432\u0435\u0434\u0443\u0449\u0438\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u044d\u0442\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438. \u041e\u0434\u043d\u0430\u043a\u043e \u0434\u0430\u0436\u0435 \u0441 \u043e\u0442\u043b\u0438\u0447\u043d\u043e\u0439 \u0440\u0435\u043f\u0443\u0442\u0430\u0446\u0438\u0435\u0439 \u0438 \u0448\u0438\u0440\u043e\u043a\u0438\u043c \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u0435\u043c \u0432\u0430\u0436\u043d\u044b\u043c\u0438 \u0430\u0441\u043f\u0435\u043a\u0442\u0430\u043c\u0438, \u0442\u0440\u0435\u0431\u0443\u044e\u0449\u0438\u043c\u0438 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0430, \u043e\u0441\u0442\u0430\u044e\u0442\u0441\u044f \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u043a\u043e\u0434\u0430 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445.<\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c\u044b\u0439 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 <a href=\"https:\/\/github.com\/nopSolutions\/nopCommerce\/tree\/45d416f9936eb3a446d5193c61930f0a3b3c9a79\">\u043a\u043e\u043c\u043c\u0438\u0442\u0443<\/a>. \u0414\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0431\u044b\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 <a href=\"https:\/\/pvs-studio.ru\/ru\/pvs-studio\/\">PVS-Studio<\/a> \u0432\u0435\u0440\u0441\u0438\u0438 7.29.<\/p>\n<p>\u0425\u043e\u0447\u0435\u0442\u0441\u044f \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0443\u0434\u0443\u0442 \u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u043d\u0430 \u043e\u0448\u0438\u0431\u043a\u0438, \u043d\u043e \u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435\u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u044b\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430.<\/p>\n<p>\u041f\u0440\u0438\u044f\u0442\u043d\u043e\u0433\u043e \u0447\u0442\u0435\u043d\u0438\u044f!<\/p>\n<h3>\u041d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043e\u0442\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0418\u0437 \u0440\u0430\u0437\u0430 \u0432 \u0440\u0430\u0437 \u043c\u044b \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0435\u043c\u0441\u044f \u0441 \u043e\u0433\u0440\u043e\u043c\u043d\u044b\u043c \u0447\u0438\u0441\u043b\u043e\u043c \u043e\u0448\u0438\u0431\u043e\u043a, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441 <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/terms\/6694\/\">NRE<\/a>. \u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u0431\u044b\u0442\u044c \u0433\u043e\u043b\u043e\u0441\u043b\u043e\u0432\u043d\u044b\u043c, \u043e\u0441\u0442\u0430\u0432\u043b\u044e \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u043a\u0435\u0439\u0441\u044b, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u044b \u0443\u0436\u0435 \u043f\u0438\u0441\u0430\u043b\u0438 \u0432 \u0441\u0442\u0430\u0442\u044c\u044f\u0445:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/examples\/v3080\/\">\u043a\u0435\u0439\u0441\u044b \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0438 V3080<\/a>;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/examples\/v3095\/\">\u043a\u0435\u0439\u0441\u044b \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0438 V3095<\/a>;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/examples\/v3105\/\">\u043a\u0435\u0439\u0441\u044b \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0438 V3105<\/a>.<\/p>\n<\/li>\n<\/ul>\n<p>\u0418 \u044d\u0442\u043e \u043b\u0438\u0448\u044c \u0447\u0430\u0441\u0442\u044c \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u0440\u0430\u0432\u0438\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0438\u0433\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u044e\u0442 \u043e \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0438.<\/p>\n<p>\u041f\u0440\u043e\u0435\u043a\u0442 nopCommerce \u043d\u0435 \u0441\u0442\u0430\u043b \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c: \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439, \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043d\u044b\u0445 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435, \u0441\u0432\u044f\u0437\u0430\u043d\u044b \u0441 NRE.<\/p>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432 \u0440\u044f\u0434\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b. \u042d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0431\u0443\u0441\u043b\u043e\u0432\u043b\u0435\u043d\u043e \u0442\u0435\u043c, \u0447\u0442\u043e \u0434\u043b\u044f \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0439 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430, \u0438\u043b\u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u043e \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u041d\u043e \u0431\u0443\u0434\u0435\u043c \u0447\u0435\u0441\u0442\u043d\u044b, \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0442\u0435\u0441\u0442\u044b \u043f\u043e\u043a\u0440\u044b\u0432\u0430\u044e\u0442 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u0432\u0441\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b. \u041e\u0448\u0438\u0431\u043a\u0430 \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u0442\u0435\u0441\u0430\u0442\u044c\u0441\u044f \u0432 \u043a\u043e\u0434\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0440\u0435\u0434\u043a\u043e, \u0438 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442 \u0435\u0451 \u0443\u0436\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c. \u041a\u0430\u043a \u043c\u043d\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0442\u0430\u043a\u043e\u0439 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u043a\u0440\u0430\u0439\u043d\u0435 \u043d\u0435\u0436\u0435\u043b\u0430\u0442\u0435\u043b\u0435\u043d. \u0418\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u0438\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 \u043e\u0442 \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u0439.<\/p>\n<h3>\u041f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 Equals<\/h3>\n<p>\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0447\u0430\u0441\u0442\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0441 \u043e\u0448\u0438\u0431\u043a\u0430\u043c\u0438 \u043f\u0440\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u0435\u0442\u043e\u0434\u0430 <em>Equals<\/em>. \u041e\u0434\u0438\u043d \u0438\u0437 \u0442\u0430\u043a\u0438\u0445 \u043a\u0435\u0439\u0441\u043e\u0432 \u043c\u044b \u0443\u0436\u0435 \u0440\u0430\u043d\u0435\u0435 \u043e\u0442\u0440\u0430\u0437\u0438\u043b\u0438 \u0432 <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/csharp\/1032\/\">\u0441\u0442\u0430\u0442\u044c\u0435<\/a>.<\/p>\n<p>\u0427\u0442\u043e \u0443\u0436 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c, \u043c\u044b \u0438 \u0441\u0430\u043c\u0438 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043b\u0438 \u043f\u043e\u0434\u043e\u0431\u043d\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443 \u043f\u0440\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0438. \u041a\u0441\u0442\u0430\u0442\u0438, \u043e\u0448\u0438\u0431\u043a\u0430 \u0431\u044b\u043b\u0430 \u0432\u043e\u0432\u0440\u0435\u043c\u044f \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0430 \u0438 \u043d\u0430\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0430 \u043d\u0430 \u0438\u0434\u0435\u044e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430. \u041e\u043d\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u043e\u0439 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0438 <em>Equals<\/em>.<\/p>\n<p>\u041e\u0448\u0438\u0431\u043a\u0430, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u0430\u044f \u0432 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0442\u0438\u043f\u0438\u0447\u043d\u0430, \u043d\u043e \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u043d\u0435\u0435 \u043e\u043f\u0430\u0441\u043d\u043e\u0439 \u043e\u043d\u0430 \u043d\u0435 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f.<\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 1<\/strong><\/p>\n<pre><code class=\"cs\">public partial class CategoryKey {   ....    public bool Equals(CategoryKey y)   {     if (y == null)       return false;      if (Category != null &amp;&amp; y.Category != null)       return Category.Id == y.Category.Id;      if (....)     {       return false;     }      return Key.Equals(y.Key);   }    public override bool Equals(object obj)   {     var other = obj as CategoryKey;     return other?.Equals(other) ?? false;        \/\/ &lt;=   } } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3062\/\">V3062<\/a> An object &#8216;other&#8217; is used as an argument to its own method. Consider checking the first actual argument of the &#8216;Equals&#8217; method. ImportManager.cs 3392<\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0432\u044b\u0437\u043e\u0432 \u043c\u0435\u0442\u043e\u0434\u0430 <em>Equals<\/em> \u0432 \u0442\u0435\u043b\u0435 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0433\u043e <em>Equals<\/em>. \u041c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043c\u0435\u0442\u043e\u0434 \u0432\u044b\u0437\u0432\u0430\u043d \u0443 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <em>other.<\/em> \u041e\u043d\u0430 \u0436\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u0430\u043c \u0441 \u0441\u043e\u0431\u043e\u0439. \u0421\u043e\u043c\u043d\u0435\u0432\u0430\u044e\u0441\u044c, \u0447\u0442\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0437\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u043b\u0438 \u0442\u0430\u043a\u0443\u044e \u043b\u043e\u0433\u0438\u043a\u0443 \u0432 \u0440\u0430\u0431\u043e\u0442\u0443 \u043c\u0435\u0442\u043e\u0434\u0430 <em>Equals<\/em>.<\/p>\n<p>\u0414\u043b\u044f \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043e\u0448\u0438\u0431\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c <em>this<\/em>, \u0430 \u043d\u0435 <em>other<\/em>, \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 <em>Equals<\/em>.<\/p>\n<h3>\u041d\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f<\/h3>\n<p>\u041d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u043e\u0433\u0440\u0435\u0448\u043d\u043e\u0441\u0442\u0438, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 \u043d\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438, \u043f\u0440\u0438\u0432\u043e\u0434\u044f\u0442 \u043a \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u044e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u0438\u043b\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044e \u043b\u043e\u0433\u0438\u043a\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b. \u041e\u0434\u043d\u0430\u043a\u043e \u0438 \u0442\u0430\u043a\u0438\u0435 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u043c\u043e\u0433\u0443\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c. \u0412 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0443\u0436\u043d\u043e \u0438\u0437\u0431\u0435\u0433\u0430\u0442\u044c \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u043c\u043e\u043c\u0435\u043d\u0442\u043e\u0432. \u041a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u044d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u043e\u0434 \u0447\u0438\u0449\u0435, \u043a\u0430\u043a \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c \u2014 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0433\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u043d\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f.<\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 2<\/strong><\/p>\n<pre><code class=\"cs\">protected virtual async Task&lt;....> PrepareCheckoutPickupPointsModelAsync(....) {   ....    if (amount > 0)   {     (amount, _) = await         _taxService.GetShippingPriceAsync(amount, customer);      amount = await        _currencyService.ConvertFromPrimaryStoreCurrencyAsync(amount,                                                              currentCurrency);      pickupPointModel.PickupFee = await                              \/\/ &lt;=        _priceFormatter.FormatShippingPriceAsync(amount, true);   }    \/\/adjust rate   var (shippingTotal, _) = await      _orderTotalCalculationService.AdjustShippingRateAsync(point.PickupFee,                                                            cart,                                                            true);   var (rateBase, _) = await       _taxService.GetShippingPriceAsync(shippingTotal, customer);    var rate = await      _currencyService.ConvertFromPrimaryStoreCurrencyAsync(rateBase,                                                            currentCurrency);    pickupPointModel.PickupFee = await                                \/\/ &lt;=      _priceFormatter.FormatShippingPriceAsync(rate, true);    .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3008\/\">V3008<\/a> The &#8216;pickupPointModel.PickupFee&#8217; variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 210, 203. CheckoutModelFactory.cs 210<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u044f \u0432 <em>pickupPointModel.PickupFee<\/em> \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u0438 \u044d\u0442\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u041f\u043e\u0434\u043e\u0431\u043d\u043e\u0435 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0441\u043c\u044b\u0441\u043b, \u0435\u0441\u043b\u0438 \u0430\u043a\u0441\u0435\u0441\u0441\u043e\u0440 <em>set<\/em> \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0438\u043c\u0435\u0435\u0442 \u043a\u0430\u043a\u0443\u044e-\u0442\u043e \u043e\u0441\u043e\u0431\u0443\u044e \u043b\u043e\u0433\u0438\u043a\u0443. \u041e\u0434\u043d\u0430\u043a\u043e \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e \u043d\u0435 \u0442\u0430\u043a, <em>pickupPointModel.PickupFee<\/em> \u2014 \u043e\u0431\u044b\u0447\u043d\u043e\u0435 \u0430\u0432\u0442\u043e\u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 <em>then<\/em>-\u0432\u0435\u0442\u0432\u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 <em>if<\/em> \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u043b\u043e\u0433\u0438\u043a\u0443 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b.<\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 3<\/strong><\/p>\n<pre><code class=\"cs\">public virtual async Task&lt;....> GetOrderAverageReportLineAsync(....) {   ....    if (!string.IsNullOrEmpty(orderNotes))   {     query = from o in query             join n in _orderNoteRepository.Table on o.Id equals n.OrderId             where n.Note.Contains(orderNotes)             select o;      query.Distinct();                          \/\/ &lt;=   }    .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3010\/\">V3010<\/a> The return value of function &#8216;Distinct&#8217; is required to be utilized. OrderReportService.cs 342<\/p>\n<p>\u0414\u043b\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0449\u0438\u0445\u0441\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <em>Distinct<\/em> (\u043c\u0435\u0442\u043e\u0434 LINQ). \u0422\u0430\u043a \u0438 \u0445\u043e\u0442\u0435\u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0432 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435, \u043d\u043e \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u0448\u043b\u043e \u043d\u0435 \u0442\u0430\u043a. \u041c\u0435\u0442\u043e\u0434 <em>Distinct<\/em> \u043d\u0435 \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u0435\u0442 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044e, \u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f. \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0435\u0441\u043b\u0438 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u0430, \u0442\u043e \u0432\u044b\u0437\u043e\u0432 \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430. \u0418\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a\u0430\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u0432 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c\u043e\u043c \u043a\u043e\u0434\u0435.<\/p>\n<p>\u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f <em>Distinct<\/em> \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <em>query<\/em>.<\/p>\n<h3>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 null<\/h3>\n<p>\u0417\u0434\u0435\u0441\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0435, \u0435\u0441\u043b\u0438 \u0438\u0445 \u0442\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0437\u0432\u0430\u0442\u044c, \u043e\u0448\u0438\u0431\u043a\u0438. \u041e\u0441\u043e\u0431\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u0435\u0447\u0435\u0433\u043e, \u0441 NRE \u0437\u043d\u0430\u043a\u043e\u043c\u044b \u0432\u0441\u0435.<\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 4<\/strong><\/p>\n<pre><code class=\"cs\">public async Task&lt;....> GetTaxTotalAsync(TaxTotalRequest taxTotalRequest) {   ....    var taxRates = transaction.summary                             ?.Where(....)                             .Select(....)                             .ToList();    foreach (var taxRate in taxRates)                              \/\/ &lt;=   {     if (taxTotalResult.TaxRates.ContainsKey(taxRate.Rate))       taxTotalResult.TaxRates[taxRate.Rate] += taxRate.Value;     else       taxTotalResult.TaxRates.Add(taxRate.Rate, taxRate.Value);   }    .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3105\/\">V3105<\/a> The &#8216;taxRates&#8217; variable was used after it was assigned through null-conditional operator. NullReferenceException is possible. AvalaraTaxProvider.cs 113<\/p>\n<p>\u041f\u0440\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f <em>taxRates<\/em> \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043a \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0443 <em>transaction.summary<\/em> \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 &#8216;?.&#8217;. \u0421\u0443\u0434\u044f \u043f\u043e \u0432\u0441\u0435\u043c\u0443, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u043b, \u0447\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c <em>null<\/em>. \u0415\u0441\u043b\u0438 \u044d\u0442\u043e \u0442\u0430\u043a, \u0442\u043e \u0438 \u0432 <em>taxRates<\/em> \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d <em>null<\/em>. \u0421\u0440\u0430\u0437\u0443 \u043f\u043e\u0441\u043b\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 <em>taxRates<\/em> \u044d\u0442\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u0442\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 <em>foreach<\/em>. \u0415\u0441\u043b\u0438 <em>taxRates<\/em> \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>null<\/em>, \u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0431\u0440\u043e\u0448\u0435\u043d\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u0430 <em>NullReferenceException<\/em>. \u042d\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442 \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0443 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u043d\u0435\u044f\u0432\u043d\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434 <em>GetEnumerator<\/em>.<\/p>\n<p>\u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u044d\u0442\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0451\u043d\u043d\u044b\u0439 \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u043e\u0448\u0438\u0431\u043a\u0438. \u041e \u043d\u0451\u043c \u043c\u044b \u0443\u0436\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u043b\u0438 \u0432 <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/csharp\/0832\/\">\u0441\u0442\u0430\u0442\u044c\u0435<\/a>.<\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 5<\/strong><\/p>\n<pre><code class=\"cs\">public async Task&lt;....> GoogleAuthenticatorDelete(....) {   ....    \/\/delete configuration   var configuration =      await _googleAuthenticatorService.GetConfigurationByIdAsync(model.Id);    if (configuration != null)   {     await _googleAuthenticatorService                      .DeleteConfigurationAsync(configuration);   }    var customer = await _customerService                          .GetCustomerByEmailAsync(configuration.Customer) ??                  await _customerService                          .GetCustomerByUsernameAsync(configuration.Customer);    .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3125\/\">V3125<\/a> The &#8216;configuration&#8217; object was used after it was verified against null. Check lines: 139, 135. GoogleAuthenticatorController.cs 139<\/p>\n<p>\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <em>configuration<\/em> \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043d\u0430 <em>null<\/em> \u043f\u0435\u0440\u0435\u0434 \u043f\u0435\u0440\u0432\u044b\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c, \u0430 \u043f\u0440\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u043d\u0435\u0442. \u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043c\u0435\u0442\u043e\u0434 <em>GetConfigurationByIdAsync<\/em>, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u044b\u043b\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439, \u043c\u043e\u0436\u0435\u0442 \u0432\u0435\u0440\u043d\u0443\u0442\u044c <em>null<\/em>. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0443\u0432\u0435\u0440\u0435\u043d\u044b, \u0447\u0442\u043e \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 <em>null<\/em> \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0451\u043d. \u0422\u043e\u0433\u0434\u0430 \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0437\u0430\u0447\u0435\u043c \u043d\u0443\u0436\u043d\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430 <em>null<\/em>. \u0412 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0436\u0435 \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0438\u0437-\u0437\u0430 \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0438.<\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 6<\/strong><\/p>\n<pre><code class=\"cs\">public async Task&lt;....> RefundAsync(.... refundPaymentRequest)   {   ....    var clientReferenceInformation =           new Ptsv2paymentsClientReferenceInformation(Code: refundPaymentRequest                                                                     .Order                                                                     ?.OrderGuid                                                                     .ToString(),                                                                     ....);   ....   if (refundPaymentRequest.Order.AllowStoringCreditCardNumber)            \/\/ &lt;=   {     var cardInformation = new Ptsv2paymentsidrefundsPaymentInformationCard(      Number: CreditCardHelper.RemoveSpecialCharacters(                                 _encryptionService                                         .DecryptText(refundPaymentRequest                                                          .Order                                                          ?.CardNumber)),       ExpirationMonth: _encryptionService.DecryptText(refundPaymentRequest                                                          .Order                                                          ?.CardExpirationMonth),       ExpirationYear: _encryptionService.DecryptText(refundPaymentRequest                                                         .Order                                                         ?.CardExpirationYear));     ....    }   ....   var result = await apiInstance.RefundCaptureAsync(                                    refundCaptureRequest: requestObj,                                    id:       refundPaymentRequest                                                  .Order                                                  ?.CaptureTransactionId                                           ??                                              refundPaymentRequest                                                  .Order                                                  ?.AuthorizationTransactionId);   .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3095\/\">V3095<\/a> The &#8216;refundPaymentRequest.Order&#8217; object was used before it was verified against null. Check lines: 597, 600. CyberSourceService.cs 597<\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e <em>refundPaymentRequest.Order<\/em>. \u041e\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u043e \u043d\u0430 <em>null<\/em> \u0448\u0435\u0441\u0442\u044c \u0440\u0430\u0437, \u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u0441\u0435\u043c\u044c. \u0427\u0442\u043e-\u0442\u043e \u0442\u0443\u0442 \u043d\u0435 \u0441\u0445\u043e\u0434\u0438\u0442\u0441\u044f. \u041f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0447\u0442\u043e \u0432 \u0443\u0441\u043b\u043e\u0432\u0438\u0438 <em>if<\/em> \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043a <em>refundPaymentRequest.Order<\/em> \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f &#8216;?.&#8217;. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043e\u043d\u043e \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>null<\/em> \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430. \u0422\u043e\u0433\u0434\u0430 \u0441\u0442\u043e\u0438\u0442 \u0443\u0431\u0440\u0430\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0432 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445. \u0415\u0441\u043b\u0438 \u0436\u0435 <em>refundPaymentRequest.Order<\/em> \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c <em>null<\/em>, \u0442\u043e \u0440\u0430\u043d\u043e \u0438\u043b\u0438 \u043f\u043e\u0437\u0434\u043d\u043e \u0432\u044b\u0437\u043e\u0432 <em>RefundAsync<\/em> \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u0442 \u043a \u0432\u044b\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u043d\u0438\u044e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0442\u0438\u043f\u0430 <em>NullReferenceException<\/em>.<\/p>\n<h3>\u041d\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0434\u043d\u043e\u0439 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438<\/h3>\n<p>\u041a\u0430\u043a \u0447\u0430\u0441\u0442\u043e \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 <em>while<\/em> \u0432\u043c\u0435\u0441\u0442\u043e <em>if<\/em>? \u0414\u0443\u043c\u0430\u044e, \u0447\u0442\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0440\u0435\u0434\u043a\u043e.<\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u0432\u0435\u0441\u044c\u043c\u0430 \u043d\u0435\u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f <em>while<\/em>.<\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 7<\/strong><\/p>\n<pre><code class=\"cs\">protected virtual TrieNode GetOrAddNode(ReadOnlySpan&lt;char> key,                                         TValue value,                                         bool overwrite = false) {   ....    while (!node.IsDeleted &amp;&amp; node.Children.TryGetValue(c, out nextNode))   {     var label = nextNode.Label.AsSpan();     var i = GetCommonPrefixLength(label, suffix);      \/\/ suffix starts with label?     if (i == label.Length)     {       \/\/ if the keys are equal, the key has already been inserted       if (i == suffix.Length)       {         if (overwrite)           nextNode.SetValue(value);          return nextNode;       }        \/\/ structure has changed since last; try again       break;     }      ....      return outNode;                                            \/\/ &lt;=   }    .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3020\/\">V3020<\/a> An unconditional &#8216;return&#8217; within a loop. ConcurrentTrie.cs 230<\/p>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0441\u043e\u043c\u043d\u0435\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0446\u0438\u043a\u043b\u0430. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0442\u0443\u0442 \u043d\u0435 \u0442\u0430\u043a. \u0412 \u0442\u0435\u043b\u0435 \u0446\u0438\u043a\u043b\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <em>return<\/em>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0431\u0435\u0437 \u0443\u0441\u043b\u043e\u0432\u0438\u044f. \u042d\u0442\u043e \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0448\u0438\u0431\u043a\u043e\u0439, \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u0435\u0440\u0435\u0434 <em>return<\/em> \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b <em>continue<\/em>. \u0412\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435 \u044d\u0442\u043e\u0433\u043e <em>return<\/em> \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u0439 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438 \u0446\u0438\u043a\u043b\u0430. \u041e\u0434\u043d\u0430\u043a\u043e \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 <em>continue<\/em> \u043d\u0435\u0442. \u0412\u044b\u0445\u043e\u0434 \u0438\u0437 \u0446\u0438\u043a\u043b\u0430 \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u043f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u0439 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438.<\/p>\n<p>\u0412\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0432\u044b\u0445\u043e\u0434\u0430 \u0438\u0437 \u0446\u0438\u043a\u043b\u0430:<\/p>\n<ul>\n<li>\n<p>\u043b\u0438\u0431\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <em>return<\/em>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0442\u0435\u043b\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 <em>if<\/em>;<\/p>\n<\/li>\n<li>\n<p>\u043b\u0438\u0431\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <em>break<\/em> (\u0442\u0430\u043a\u0436\u0435 \u0432 \u0442\u0435\u043b\u0435 <em>if<\/em>);<\/p>\n<\/li>\n<li>\n<p>\u043b\u0438\u0431\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <em>return<\/em> \u0432 \u0441\u0430\u043c\u043e\u043c \u043a\u043e\u043d\u0446\u0435 \u0446\u0438\u043a\u043b\u0430.<\/p>\n<\/li>\n<\/ul>\n<p>\u0421\u043b\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u043f\u0440\u0438 \u043a\u0430\u043a\u043e\u043c \u0443\u0441\u043b\u043e\u0432\u0438\u0438 \u0434\u043e\u043b\u0436\u0435\u043d \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0442\u044c\u0441\u044f \u0446\u0438\u043a\u043b \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435. \u041d\u043e \u043c\u043e\u0436\u043d\u043e \u0442\u043e\u0447\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0446\u0438\u043a\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u043c\u0435\u0435\u0442 \u043d\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0434\u043d\u043e\u0439 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438, \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432\u0435\u0441\u044c\u043c\u0430 \u0441\u0442\u0440\u0430\u043d\u043d\u043e.<\/p>\n<p>\u041a\u0430\u043a \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u043f\u0435\u0440\u0435\u0434 \u043d\u0430\u043c\u0438, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0430, \u0438 \u0432\u043c\u0435\u0441\u0442\u043e <em>break<\/em> \u0434\u043e\u043b\u0436\u0435\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <em>continue<\/em>. \u041d\u0430 \u044d\u0442\u043e \u043d\u0430\u043c\u0435\u043a\u0430\u0435\u0442 \u0444\u0440\u0430\u0437\u0430 &#171;try again&#187; \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438.<\/p>\n<h3>\u041f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430<\/h3>\n<p>\u041a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u0430\u044f \u0441 Copy-Paste.<\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 8<\/strong><\/p>\n<pre><code class=\"cs\">public async Task&lt;bool?> IsConditionMetAsync(string conditionAttributeXml,                                               string selectedAttributesXml) {   if (string.IsNullOrEmpty(conditionAttributeXml))     return null;    if (string.IsNullOrEmpty(conditionAttributeXml))     \/\/no condition     return null;    .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3022\/\">V3022<\/a> Expression &#8216;string.IsNullOrEmpty(conditionAttributeXml)&#8217; is always false. AttributeParser.cs 499<\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0432\u0442\u043e\u0440\u043e\u0433\u043e <em>if<\/em>. \u0412 \u043d\u0451\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044f <em>conditionAttributeXml<\/em>. \u042d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432\u0435\u0441\u044c\u043c\u0430 \u0441\u0442\u0440\u0430\u043d\u043d\u043e, \u0442\u0430\u043a \u043a\u0430\u043a \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c <em>if<\/em> \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b\u043e\u0441\u044c \u044d\u0442\u043e \u0436\u0435 \u043f\u043e\u043b\u0435. \u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0432 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u0434\u043b\u044f \u043c\u0435\u0442\u043e\u0434\u0430 <em>IsNullOrEmpty<\/em> \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <em>selectedAttributesXml<\/em>.<\/p>\n<h3>\u041b\u043e\u0436\u043d\u044b\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f?<\/h3>\n<p>\u041d\u0435 \u043f\u0440\u043e \u043a\u0430\u0436\u0434\u043e\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u043e\u043d\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u043e\u0436\u043d\u044b\u043c \u0438\u043b\u0438, \u043d\u0430\u043f\u0440\u043e\u0442\u0438\u0432, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u043e\u0448\u0438\u0431\u043a\u0443. \u0418\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a\u0438\u0435 \u0441\u043b\u0443\u0447\u0430\u0438 \u0431\u0443\u0434\u0443\u0442 \u043e\u0442\u0440\u0430\u0436\u0435\u043d\u044b \u0432 \u044d\u0442\u043e\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0441\u043e\u043c\u043d\u0435\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u043a\u043e\u0434\u0435, \u0442\u043e \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u043f\u043e\u0447\u0442\u0438 \u043d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430 \u0432\u044b\u0437\u043e\u0432\u0435\u0442 \u043d\u0435\u0434\u043e\u0443\u043c\u0435\u043d\u0438\u0435 \u0438 \u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0435\u0433\u043e \u0441\u043e\u043f\u0440\u043e\u0432\u043e\u0436\u0434\u0430\u0442\u044c. \u0422\u0430\u043a\u0438\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f \u2014 \u0445\u043e\u0440\u043e\u0448\u0438\u0439 \u043f\u043e\u0432\u043e\u0434 \u0434\u043b\u044f \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430. \u041a\u0441\u0442\u0430\u0442\u0438, \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/cpp\/0968\/\">\u0437\u0430\u043c\u0435\u0442\u043a\u0430 \u043d\u0430 \u044d\u0442\u043e\u0442 \u0441\u0447\u0451\u0442<\/a>.<\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 9<\/strong><\/p>\n<pre><code class=\"cs\">protected virtual async Task              PrepareSimpleProductOverviewPriceModelAsync(Product product,                                                          .... priceModel) {   ....    if (product.IsRental)   {     \/\/rental product     priceModel.OldPrice = await _priceFormatter                                   .FormatRentalProductPeriodAsync(....);      priceModel.OldPriceValue = priceModel.OldPriceValue;      priceModel.Price = await _priceFormatter                                .FormatRentalProductPeriodAsync(....);      priceModel.PriceValue = priceModel.PriceValue;   }    .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f PVS-Studio:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3005\/\">V3005<\/a> The &#8216;priceModel.OldPriceValue&#8217; variable is assigned to itself. ProductModelFactory.cs 503<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3005\/\">V3005<\/a> The &#8216;priceModel.PriceValue&#8217; variable is assigned to itself. ProductModelFactory.cs 505<\/p>\n<\/li>\n<\/ul>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442, \u0447\u0442\u043e <em>priceModel.OldPriceValue<\/em> \u0438 <em>priceModel.PriceValue<\/em> \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0441\u0430\u043c\u0438 \u0441\u0435\u0431\u0435. \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u043e\u0448\u0438\u0431\u043a\u0438 \u0437\u0434\u0435\u0441\u044c \u043d\u0435\u0442, \u043e\u0434\u043d\u0430\u043a\u043e \u0438 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u043b\u043e\u0436\u043d\u044b\u043c \u043d\u0430\u0437\u0432\u0430\u0442\u044c \u043d\u0435\u043b\u044c\u0437\u044f. \u041a\u0430\u043a \u0436\u0435 \u0442\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c? \u0412\u0441\u0451 \u0434\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0447\u0430\u0441\u0442\u044c \u043a\u043e\u0434\u0430 \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u0430. \u0415\u0441\u043b\u0438 \u0443\u0431\u0440\u0430\u0442\u044c \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c <em>priceModel.OldPriceValue<\/em> \u0438 <em>priceModel.PriceValue<\/em>, \u043b\u043e\u0433\u0438\u043a\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0441\u044f.<\/p>\n<p>\u0421\u0435\u0439\u0447\u0430\u0441 \u0436\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0432\u043e\u043f\u0440\u043e\u0441: \u0431\u044b\u043b\u043e \u043b\u0438 \u0437\u0430\u0434\u0443\u043c\u0430\u043d\u043e, \u0447\u0442\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u043c \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u043b\u0438 \u043d\u0435\u0442? \u0415\u0441\u043b\u0438 \u0434\u0430, \u0442\u043e \u043f\u043e\u0447\u0435\u043c\u0443 \u0442\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u0438\u043c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u043c?<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u043b\u043e \u043c\u0435\u043d\u044c\u0448\u0435 (\u0438\u043b\u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u0431\u044b\u043b\u043e), \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u0442\u0443\u043f\u0438\u0442\u044c \u0434\u0432\u0443\u043c\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438:<\/p>\n<ul>\n<li>\n<p>\u0443\u0431\u0440\u0430\u0442\u044c \u043b\u0438\u0448\u043d\u0438\u0435 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u044f;<\/p>\n<\/li>\n<li>\n<p>\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439, \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u044e\u0449\u0438\u0439 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0438\u0445 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0439.<\/p>\n<\/li>\n<\/ul>\n<p>\u041e\u0431\u0430 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u043e\u0434 \u0447\u0443\u0442\u044c \u043b\u0443\u0447\u0448\u0435 \ud83d\ude42<\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 10<\/strong><\/p>\n<pre><code class=\"cs\">public abstract partial class BaseNopValidator&lt;TModel>               : AbstractValidator&lt;TModel> where TModel : class {   protected BaseNopValidator()   {     PostInitialize();   }    \/\/\/ &lt;summary>   \/\/\/ Developers can override this method in    \/\/\/ custom partial classes in order to add    \/\/\/ some custom initialization code to constructors   \/\/\/ &lt;\/summary>   protected virtual void PostInitialize()   {   }    .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3068\/\">V3068<\/a> Calling overrideable class member &#8216;PostInitialize&#8217; from constructor is dangerous. BaseNopValidator.cs 20<\/p>\n<p>\u041f\u0440\u043e \u044d\u0442\u043e \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0442\u0430\u043a\u0436\u0435 \u043d\u0435\u043b\u044c\u0437\u044f \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u043e\u043d\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u043e\u0448\u0438\u0431\u043a\u0443. \u041f\u043e\u0447\u0435\u043c\u0443? \u0414\u043b\u044f \u043e\u0442\u0432\u0435\u0442\u0430 \u043d\u0430 \u044d\u0442\u043e\u0442 \u0432\u043e\u043f\u0440\u043e\u0441 \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u0441\u0443\u0442\u0438 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f.<\/p>\n<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a \u043a\u043b\u0430\u0441\u0441\u0430 <em>BaseNopValidator<\/em>, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <em>TestValidator<\/em>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u043c\u0435\u0442\u043e\u0434 <em>PostInitialize<\/em>:<\/p>\n<pre><code class=\"cs\">public class TestValidator : BaseNopValidator&lt;object> {   Logger _logger;    public TestValidator(Logger logger)   {     _logger = logger;   }    protected override void PostInitialize()   {     _logger.Log(\"Initializing\");   } } <\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 \u0442\u0438\u043f\u0430 <em>TestValidator<\/em>, \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0431\u0440\u043e\u0448\u0435\u043d\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u0430 <em>NullReferenceException<\/em>. \u042d\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442 \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430, \u0430 \u0443\u0436\u0435 \u043f\u043e\u0442\u043e\u043c \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 <em>TestValidator<\/em>. \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 <em>Log<\/em> \u043f\u043e\u043b\u0435 <em>_logger<\/em> \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>null<\/em>.<\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u0432 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043d\u0438 \u043e\u0434\u0438\u043d \u0438\u0437 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u043d\u0435 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u043c\u0435\u0442\u043e\u0434 <em>PostInitialize<\/em>. \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0437\u0434\u0435\u0441\u044c \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c \u043d\u0435 \u043c\u043e\u0436\u0435\u0442. \u041d\u043e \u044d\u0442\u043e \u043f\u043e\u043a\u0430.<\/p>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u041f\u043e \u0438\u0442\u043e\u0433\u0443 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u043a\u043e\u0434 \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0447\u0438\u0441\u0442\u044b\u043c, \u043d\u043e \u043d\u0435 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u044b\u043c \ud83d\ude42<\/p>\n<p>\u041c\u043d\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0441\u0442\u043e\u0438\u0442 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0442\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0432 \u0441\u0442\u0430\u0442\u044c\u0435. \u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0434\u043b\u044f \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0431\u044b\u043b\u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u043d\u044b \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f. \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0437\u0434\u0435\u0441\u044c.<\/p>\n<p>\u0414\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0435\u0433\u043e \u0432\u0430\u0441 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043c\u043e\u0436\u043d\u043e <a href=\"https:\/\/pvs-studio.ru\/ru\/pvs-studio\/try-free\/?utm_source=website&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=1109\">\u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c PVS-Studio<\/a>.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435\u0439 \u0441 \u0430\u043d\u0433\u043b\u043e\u044f\u0437\u044b\u0447\u043d\u043e\u0439 \u0430\u0443\u0434\u0438\u0442\u043e\u0440\u0438\u0435\u0439, \u0442\u043e \u043f\u0440\u043e\u0448\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043f\u0435\u0440\u0435\u0432\u043e\u0434: Nikita Panevin. <a href=\"https:\/\/pvs-studio.com\/en\/blog\/posts\/csharp\/1109\/\">Invincible null: digging into nopCommerce source code<\/a>.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/801909\/\"> https:\/\/habr.com\/ru\/articles\/801909\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>nopCommerce \u2014 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u0430\u044f \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u043c\u0430\u0433\u0430\u0437\u0438\u043d\u043e\u0432 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u0430\u044f \u043d\u0430 \u0431\u0430\u0437\u0435 ASP.NET Core. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u0443\u0437\u043d\u0430\u0435\u043c, \u043a\u0430\u043a\u0438\u0435 \u043d\u0435\u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u044b\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b \u0442\u0430\u044f\u0442\u0441\u044f \u0432 \u043a\u043e\u0434\u0435 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b.<\/p>\n<figure class=\"full-width\"><\/figure>\n<h3>\u041f\u0430\u0440\u0430 \u0441\u043b\u043e\u0432 \u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0435<\/h3>\n<p>\u041f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u041f\u041e \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u043e\u0434\u0430 \u0438\u0433\u0440\u0430\u0435\u0442 \u0440\u0435\u0448\u0430\u044e\u0449\u0443\u044e \u0440\u043e\u043b\u044c \u0432 \u043d\u0430\u0434\u0451\u0436\u043d\u043e\u0441\u0442\u0438, \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0445 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432.<\/p>\n<p>nopCommerce \u2014 \u043e\u0442\u043a\u0440\u044b\u0442\u0430\u044f \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u043e\u0439 \u043a\u043e\u043c\u043c\u0435\u0440\u0446\u0438\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 ASP.NET Core. \u041e\u043d\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u0432\u0435\u0434\u0443\u0449\u0438\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u044d\u0442\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438. \u041e\u0434\u043d\u0430\u043a\u043e \u0434\u0430\u0436\u0435 \u0441 \u043e\u0442\u043b\u0438\u0447\u043d\u043e\u0439 \u0440\u0435\u043f\u0443\u0442\u0430\u0446\u0438\u0435\u0439 \u0438 \u0448\u0438\u0440\u043e\u043a\u0438\u043c \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u0435\u043c \u0432\u0430\u0436\u043d\u044b\u043c\u0438 \u0430\u0441\u043f\u0435\u043a\u0442\u0430\u043c\u0438, \u0442\u0440\u0435\u0431\u0443\u044e\u0449\u0438\u043c\u0438 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0430, \u043e\u0441\u0442\u0430\u044e\u0442\u0441\u044f \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0430 \u043a\u043e\u0434\u0430 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445.<\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c\u044b\u0439 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 <a href=\"https:\/\/github.com\/nopSolutions\/nopCommerce\/tree\/45d416f9936eb3a446d5193c61930f0a3b3c9a79\">\u043a\u043e\u043c\u043c\u0438\u0442\u0443<\/a>. \u0414\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0431\u044b\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 <a href=\"https:\/\/pvs-studio.ru\/ru\/pvs-studio\/\">PVS-Studio<\/a> \u0432\u0435\u0440\u0441\u0438\u0438 7.29.<\/p>\n<p>\u0425\u043e\u0447\u0435\u0442\u0441\u044f \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0443\u0434\u0443\u0442 \u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u043d\u0430 \u043e\u0448\u0438\u0431\u043a\u0438, \u043d\u043e \u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435\u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u044b\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430.<\/p>\n<p>\u041f\u0440\u0438\u044f\u0442\u043d\u043e\u0433\u043e \u0447\u0442\u0435\u043d\u0438\u044f!<\/p>\n<h3>\u041d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043e\u0442\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0418\u0437 \u0440\u0430\u0437\u0430 \u0432 \u0440\u0430\u0437 \u043c\u044b \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0435\u043c\u0441\u044f \u0441 \u043e\u0433\u0440\u043e\u043c\u043d\u044b\u043c \u0447\u0438\u0441\u043b\u043e\u043c \u043e\u0448\u0438\u0431\u043e\u043a, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441 <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/terms\/6694\/\">NRE<\/a>. \u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u0431\u044b\u0442\u044c \u0433\u043e\u043b\u043e\u0441\u043b\u043e\u0432\u043d\u044b\u043c, \u043e\u0441\u0442\u0430\u0432\u043b\u044e \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u043a\u0435\u0439\u0441\u044b, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u044b \u0443\u0436\u0435 \u043f\u0438\u0441\u0430\u043b\u0438 \u0432 \u0441\u0442\u0430\u0442\u044c\u044f\u0445:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/examples\/v3080\/\">\u043a\u0435\u0439\u0441\u044b \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0438 V3080<\/a>;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/examples\/v3095\/\">\u043a\u0435\u0439\u0441\u044b \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0438 V3095<\/a>;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/examples\/v3105\/\">\u043a\u0435\u0439\u0441\u044b \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0438 V3105<\/a>.<\/p>\n<\/li>\n<\/ul>\n<p>\u0418 \u044d\u0442\u043e \u043b\u0438\u0448\u044c \u0447\u0430\u0441\u0442\u044c \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u0440\u0430\u0432\u0438\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0438\u0433\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u044e\u0442 \u043e \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0438.<\/p>\n<p>\u041f\u0440\u043e\u0435\u043a\u0442 nopCommerce \u043d\u0435 \u0441\u0442\u0430\u043b \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c: \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439, \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043d\u044b\u0445 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435, \u0441\u0432\u044f\u0437\u0430\u043d\u044b \u0441 NRE.<\/p>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432 \u0440\u044f\u0434\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b. \u042d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0431\u0443\u0441\u043b\u043e\u0432\u043b\u0435\u043d\u043e \u0442\u0435\u043c, \u0447\u0442\u043e \u0434\u043b\u044f \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0439 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430, \u0438\u043b\u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u043e \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u041d\u043e \u0431\u0443\u0434\u0435\u043c \u0447\u0435\u0441\u0442\u043d\u044b, \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0442\u0435\u0441\u0442\u044b \u043f\u043e\u043a\u0440\u044b\u0432\u0430\u044e\u0442 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u0432\u0441\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b. \u041e\u0448\u0438\u0431\u043a\u0430 \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u0442\u0435\u0441\u0430\u0442\u044c\u0441\u044f \u0432 \u043a\u043e\u0434\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0440\u0435\u0434\u043a\u043e, \u0438 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442 \u0435\u0451 \u0443\u0436\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c. \u041a\u0430\u043a \u043c\u043d\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0442\u0430\u043a\u043e\u0439 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u043a\u0440\u0430\u0439\u043d\u0435 \u043d\u0435\u0436\u0435\u043b\u0430\u0442\u0435\u043b\u0435\u043d. \u0418\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u0438\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 \u043e\u0442 \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u0439.<\/p>\n<h3>\u041f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 Equals<\/h3>\n<p>\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0447\u0430\u0441\u0442\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0441 \u043e\u0448\u0438\u0431\u043a\u0430\u043c\u0438 \u043f\u0440\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u0435\u0442\u043e\u0434\u0430 <em>Equals<\/em>. \u041e\u0434\u0438\u043d \u0438\u0437 \u0442\u0430\u043a\u0438\u0445 \u043a\u0435\u0439\u0441\u043e\u0432 \u043c\u044b \u0443\u0436\u0435 \u0440\u0430\u043d\u0435\u0435 \u043e\u0442\u0440\u0430\u0437\u0438\u043b\u0438 \u0432 <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/csharp\/1032\/\">\u0441\u0442\u0430\u0442\u044c\u0435<\/a>.<\/p>\n<p>\u0427\u0442\u043e \u0443\u0436 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c, \u043c\u044b \u0438 \u0441\u0430\u043c\u0438 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043b\u0438 \u043f\u043e\u0434\u043e\u0431\u043d\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443 \u043f\u0440\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0438. \u041a\u0441\u0442\u0430\u0442\u0438, \u043e\u0448\u0438\u0431\u043a\u0430 \u0431\u044b\u043b\u0430 \u0432\u043e\u0432\u0440\u0435\u043c\u044f \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0430 \u0438 \u043d\u0430\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0430 \u043d\u0430 \u0438\u0434\u0435\u044e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430. \u041e\u043d\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u043e\u0439 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0438 <em>Equals<\/em>.<\/p>\n<p>\u041e\u0448\u0438\u0431\u043a\u0430, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u0430\u044f \u0432 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0442\u0438\u043f\u0438\u0447\u043d\u0430, \u043d\u043e \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u043d\u0435\u0435 \u043e\u043f\u0430\u0441\u043d\u043e\u0439 \u043e\u043d\u0430 \u043d\u0435 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f.<\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 1<\/strong><\/p>\n<pre><code class=\"cs\">public partial class CategoryKey {   ....    public bool Equals(CategoryKey y)   {     if (y == null)       return false;      if (Category != null &amp;&amp; y.Category != null)       return Category.Id == y.Category.Id;      if (....)     {       return false;     }      return Key.Equals(y.Key);   }    public override bool Equals(object obj)   {     var other = obj as CategoryKey;     return other?.Equals(other) ?? false;        \/\/ &lt;=   } } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3062\/\">V3062<\/a> An object &#8216;other&#8217; is used as an argument to its own method. Consider checking the first actual argument of the &#8216;Equals&#8217; method. ImportManager.cs 3392<\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0432\u044b\u0437\u043e\u0432 \u043c\u0435\u0442\u043e\u0434\u0430 <em>Equals<\/em> \u0432 \u0442\u0435\u043b\u0435 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0433\u043e <em>Equals<\/em>. \u041c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043c\u0435\u0442\u043e\u0434 \u0432\u044b\u0437\u0432\u0430\u043d \u0443 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <em>other.<\/em> \u041e\u043d\u0430 \u0436\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u0430\u043c \u0441 \u0441\u043e\u0431\u043e\u0439. \u0421\u043e\u043c\u043d\u0435\u0432\u0430\u044e\u0441\u044c, \u0447\u0442\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0437\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u043b\u0438 \u0442\u0430\u043a\u0443\u044e \u043b\u043e\u0433\u0438\u043a\u0443 \u0432 \u0440\u0430\u0431\u043e\u0442\u0443 \u043c\u0435\u0442\u043e\u0434\u0430 <em>Equals<\/em>.<\/p>\n<p>\u0414\u043b\u044f \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043e\u0448\u0438\u0431\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c <em>this<\/em>, \u0430 \u043d\u0435 <em>other<\/em>, \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 <em>Equals<\/em>.<\/p>\n<h3>\u041d\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f<\/h3>\n<p>\u041d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u043e\u0433\u0440\u0435\u0448\u043d\u043e\u0441\u0442\u0438, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 \u043d\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438, \u043f\u0440\u0438\u0432\u043e\u0434\u044f\u0442 \u043a \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u044e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u0438\u043b\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044e \u043b\u043e\u0433\u0438\u043a\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b. \u041e\u0434\u043d\u0430\u043a\u043e \u0438 \u0442\u0430\u043a\u0438\u0435 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u043c\u043e\u0433\u0443\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c. \u0412 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0443\u0436\u043d\u043e \u0438\u0437\u0431\u0435\u0433\u0430\u0442\u044c \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u043c\u043e\u043c\u0435\u043d\u0442\u043e\u0432. \u041a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u044d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u043e\u0434 \u0447\u0438\u0449\u0435, \u043a\u0430\u043a \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c \u2014 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0433\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u043d\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f.<\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 2<\/strong><\/p>\n<pre><code class=\"cs\">protected virtual async Task&lt;....> PrepareCheckoutPickupPointsModelAsync(....) {   ....    if (amount > 0)   {     (amount, _) = await         _taxService.GetShippingPriceAsync(amount, customer);      amount = await        _currencyService.ConvertFromPrimaryStoreCurrencyAsync(amount,                                                              currentCurrency);      pickupPointModel.PickupFee = await                              \/\/ &lt;=        _priceFormatter.FormatShippingPriceAsync(amount, true);   }    \/\/adjust rate   var (shippingTotal, _) = await      _orderTotalCalculationService.AdjustShippingRateAsync(point.PickupFee,                                                            cart,                                                            true);   var (rateBase, _) = await       _taxService.GetShippingPriceAsync(shippingTotal, customer);    var rate = await      _currencyService.ConvertFromPrimaryStoreCurrencyAsync(rateBase,                                                            currentCurrency);    pickupPointModel.PickupFee = await                                \/\/ &lt;=      _priceFormatter.FormatShippingPriceAsync(rate, true);    .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3008\/\">V3008<\/a> The &#8216;pickupPointModel.PickupFee&#8217; variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 210, 203. CheckoutModelFactory.cs 210<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u044f \u0432 <em>pickupPointModel.PickupFee<\/em> \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u0438 \u044d\u0442\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u041f\u043e\u0434\u043e\u0431\u043d\u043e\u0435 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0441\u043c\u044b\u0441\u043b, \u0435\u0441\u043b\u0438 \u0430\u043a\u0441\u0435\u0441\u0441\u043e\u0440 <em>set<\/em> \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0438\u043c\u0435\u0435\u0442 \u043a\u0430\u043a\u0443\u044e-\u0442\u043e \u043e\u0441\u043e\u0431\u0443\u044e \u043b\u043e\u0433\u0438\u043a\u0443. \u041e\u0434\u043d\u0430\u043a\u043e \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e \u043d\u0435 \u0442\u0430\u043a, <em>pickupPointModel.PickupFee<\/em> \u2014 \u043e\u0431\u044b\u0447\u043d\u043e\u0435 \u0430\u0432\u0442\u043e\u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 <em>then<\/em>-\u0432\u0435\u0442\u0432\u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 <em>if<\/em> \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u043b\u043e\u0433\u0438\u043a\u0443 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b.<\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 3<\/strong><\/p>\n<pre><code class=\"cs\">public virtual async Task&lt;....> GetOrderAverageReportLineAsync(....) {   ....    if (!string.IsNullOrEmpty(orderNotes))   {     query = from o in query             join n in _orderNoteRepository.Table on o.Id equals n.OrderId             where n.Note.Contains(orderNotes)             select o;      query.Distinct();                          \/\/ &lt;=   }    .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3010\/\">V3010<\/a> The return value of function &#8216;Distinct&#8217; is required to be utilized. OrderReportService.cs 342<\/p>\n<p>\u0414\u043b\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0449\u0438\u0445\u0441\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <em>Distinct<\/em> (\u043c\u0435\u0442\u043e\u0434 LINQ). \u0422\u0430\u043a \u0438 \u0445\u043e\u0442\u0435\u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0432 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435, \u043d\u043e \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u0448\u043b\u043e \u043d\u0435 \u0442\u0430\u043a. \u041c\u0435\u0442\u043e\u0434 <em>Distinct<\/em> \u043d\u0435 \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u0435\u0442 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044e, \u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f. \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0435\u0441\u043b\u0438 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u0430, \u0442\u043e \u0432\u044b\u0437\u043e\u0432 \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430. \u0418\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a\u0430\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u0432 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c\u043e\u043c \u043a\u043e\u0434\u0435.<\/p>\n<p>\u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f <em>Distinct<\/em> \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <em>query<\/em>.<\/p>\n<h3>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 null<\/h3>\n<p>\u0417\u0434\u0435\u0441\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0435, \u0435\u0441\u043b\u0438 \u0438\u0445 \u0442\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0437\u0432\u0430\u0442\u044c, \u043e\u0448\u0438\u0431\u043a\u0438. \u041e\u0441\u043e\u0431\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u0435\u0447\u0435\u0433\u043e, \u0441 NRE \u0437\u043d\u0430\u043a\u043e\u043c\u044b \u0432\u0441\u0435.<\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 4<\/strong><\/p>\n<pre><code class=\"cs\">public async Task&lt;....> GetTaxTotalAsync(TaxTotalRequest taxTotalRequest) {   ....    var taxRates = transaction.summary                             ?.Where(....)                             .Select(....)                             .ToList();    foreach (var taxRate in taxRates)                              \/\/ &lt;=   {     if (taxTotalResult.TaxRates.ContainsKey(taxRate.Rate))       taxTotalResult.TaxRates[taxRate.Rate] += taxRate.Value;     else       taxTotalResult.TaxRates.Add(taxRate.Rate, taxRate.Value);   }    .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3105\/\">V3105<\/a> The &#8216;taxRates&#8217; variable was used after it was assigned through null-conditional operator. NullReferenceException is possible. AvalaraTaxProvider.cs 113<\/p>\n<p>\u041f\u0440\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f <em>taxRates<\/em> \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043a \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0443 <em>transaction.summary<\/em> \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 &#8216;?.&#8217;. \u0421\u0443\u0434\u044f \u043f\u043e \u0432\u0441\u0435\u043c\u0443, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u043b, \u0447\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c <em>null<\/em>. \u0415\u0441\u043b\u0438 \u044d\u0442\u043e \u0442\u0430\u043a, \u0442\u043e \u0438 \u0432 <em>taxRates<\/em> \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d <em>null<\/em>. \u0421\u0440\u0430\u0437\u0443 \u043f\u043e\u0441\u043b\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 <em>taxRates<\/em> \u044d\u0442\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u0442\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 <em>foreach<\/em>. \u0415\u0441\u043b\u0438 <em>taxRates<\/em> \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>null<\/em>, \u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0431\u0440\u043e\u0448\u0435\u043d\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u0430 <em>NullReferenceException<\/em>. \u042d\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442 \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0443 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u043d\u0435\u044f\u0432\u043d\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434 <em>GetEnumerator<\/em>.<\/p>\n<p>\u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u044d\u0442\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0451\u043d\u043d\u044b\u0439 \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u043e\u0448\u0438\u0431\u043a\u0438. \u041e \u043d\u0451\u043c \u043c\u044b \u0443\u0436\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u043b\u0438 \u0432 <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/csharp\/0832\/\">\u0441\u0442\u0430\u0442\u044c\u0435<\/a>.<\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 5<\/strong><\/p>\n<pre><code class=\"cs\">public async Task&lt;....> GoogleAuthenticatorDelete(....) {   ....    \/\/delete configuration   var configuration =      await _googleAuthenticatorService.GetConfigurationByIdAsync(model.Id);    if (configuration != null)   {     await _googleAuthenticatorService                      .DeleteConfigurationAsync(configuration);   }    var customer = await _customerService                          .GetCustomerByEmailAsync(configuration.Customer) ??                  await _customerService                          .GetCustomerByUsernameAsync(configuration.Customer);    .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3125\/\">V3125<\/a> The &#8216;configuration&#8217; object was used after it was verified against null. Check lines: 139, 135. GoogleAuthenticatorController.cs 139<\/p>\n<p>\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <em>configuration<\/em> \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043d\u0430 <em>null<\/em> \u043f\u0435\u0440\u0435\u0434 \u043f\u0435\u0440\u0432\u044b\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c, \u0430 \u043f\u0440\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u043d\u0435\u0442. \u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043c\u0435\u0442\u043e\u0434 <em>GetConfigurationByIdAsync<\/em>, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u044b\u043b\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439, \u043c\u043e\u0436\u0435\u0442 \u0432\u0435\u0440\u043d\u0443\u0442\u044c <em>null<\/em>. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0443\u0432\u0435\u0440\u0435\u043d\u044b, \u0447\u0442\u043e \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 <em>null<\/em> \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0451\u043d. \u0422\u043e\u0433\u0434\u0430 \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0437\u0430\u0447\u0435\u043c \u043d\u0443\u0436\u043d\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430 <em>null<\/em>. \u0412 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0436\u0435 \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0438\u0437-\u0437\u0430 \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0438.<\/p>\n<p><strong>\u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 6<\/strong><\/p>\n<pre><code class=\"cs\">public async Task&lt;....> RefundAsync(.... refundPaymentRequest)   {   ....    var clientReferenceInformation =           new Ptsv2paymentsClientReferenceInformation(Code: refundPaymentRequest                                                                     .Order                                                                     ?.OrderGuid                                                                     .ToString(),                                                                     ....);   ....   if (refundPaymentRequest.Order.AllowStoringCreditCardNumber)            \/\/ &lt;=   {     var cardInformation = new<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-371430","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/371430","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=371430"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/371430\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=371430"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=371430"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=371430"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}