{"id":341614,"date":"2022-11-23T15:00:44","date_gmt":"2022-11-23T15:00:44","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=341614"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=341614","title":{"rendered":"<span>\u041c\u0438\u0433\u0440\u0430\u0446\u0438\u044f \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0441 \u0433\u0435\u043e\u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0441 MS SQL \u043d\u0430 PostgreSQL<\/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<h3>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430<\/h3>\n<p>\u041d\u0435 \u0441\u0435\u043a\u0440\u0435\u0442, \u0447\u0442\u043e \u0442\u0435\u043c\u0430 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u0432 IT-\u0441\u0444\u0435\u0440\u0435 \u043d\u0430 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438, \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u044e\u0449\u0438\u0435 \u0434\u043e\u0440\u043e\u0433\u043e\u0441\u0442\u043e\u044f\u0449\u0435\u0433\u043e \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0432\u0441\u0451 \u0431\u043e\u043b\u0435\u0435 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439. \u0412 \u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f, \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e \u0438 \u0441\u0442\u0440\u0435\u043c\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0439 \u043f\u043e\u043f\u0430\u0441\u0442\u044c \u0432 \u0420\u0435\u0435\u0441\u0442\u0440 \u043e\u0442\u0435\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u041f\u041e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0440\u0430\u0437\u043d\u043e\u0433\u043e \u0440\u043e\u0434\u0430 \u043f\u0440\u0435\u0444\u0435\u0440\u0435\u043d\u0446\u0438\u0438 \u0434\u043b\u044f \u0441\u0435\u0431\u044f \u0438 \u0441\u0432\u043e\u0438\u0445 \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a\u043e\u0432.<\/p>\n<p>\u0421 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0441\u0442\u0435\u043a\u0430, \u043c\u044b \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438\u0441\u044c\u00a0<a href=\"https:\/\/ru-ikt.ru\/metodicheskiye_rekomendatsi\/\" rel=\"noopener noreferrer nofollow\">\u043c\u0435\u0442\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u044f\u043c\u0438 \u0420\u0435\u0435\u0441\u0442\u0440\u0430 \u043e\u0442\u0435\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u041f\u041e<\/a>\u00a0\u0438 \u043f\u0440\u0438\u043d\u044f\u043b\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043e \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0435 \u043d\u0430\u0448\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u043d\u0430 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438 \u0441\u043e \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u043c\u0438 \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u044f\u043c\u0438, \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438 .NET 6\u00a0\u0438 PostgreSQL. \u042d\u0442\u043e \u043e\u0442\u043a\u0440\u044b\u043b\u043e \u043d\u0430\u043c \u043f\u0443\u0442\u044c \u043a\u0430\u043a \u043a \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0438 \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u044e \u0440\u0430\u0441\u0445\u043e\u0434\u043e\u0432 \u043d\u0430 \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u0442\u0430\u043a \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044e \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u0432 \u0440\u0435\u0435\u0441\u0442\u0440.<\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043f\u0443\u0442\u044c \u043f\u043e \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0433\u0435\u043e\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0441 MS SQL \u043d\u0430 PostgreSQL \u0441 \u0444\u043e\u043a\u0443\u0441\u043e\u043c \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 (spatial) \u0442\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>\u0412\u043e\u043f\u0440\u043e\u0441 \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u0438 \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u0439 \u0438 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f MS SQL vs PostgreSQL \u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0442.\u043a. \u044d\u0442\u0430 \u0442\u0435\u043c\u0430 \u0432\u0435\u0441\u044c\u043c\u0430 \u0445\u043e\u0440\u043e\u0448\u043e \u0440\u0430\u0441\u043a\u0440\u044b\u0442\u0430 \u0432\u00a0<a href=\"https:\/\/www.youtube.com\/watch?v=3DcCX89Mz78\" rel=\"noopener noreferrer nofollow\">DotNext-\u0434\u043e\u043a\u043b\u0430\u0434\u0435<\/a>\u00a0\u043c\u043e\u0435\u0433\u043e \u043a\u043e\u043b\u043b\u0435\u0433\u0438, \u0421\u0442\u0430\u043d\u0438\u0441\u043b\u0430\u0432\u0430 \u0424\u043b\u0443\u0441\u043e\u0432\u0430 (<a class=\"mention\" href=\"\/users\/stus\">@stus<\/a>). \u0420\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u043a \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0443!<\/p>\n<h3>\u041f\u0443\u0442\u0438 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438<\/h3>\n<p>\u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0442\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 MS SQL \u0438 PostgreSQL \u0437\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u0438\u043c\u0435\u044e\u0442 \u0441\u0432\u043e\u0438 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438, \u043d\u0435\u043b\u044c\u0437\u044f \u043f\u0440\u043e\u0441\u0442\u043e \u0442\u0430\u043a \u0432\u0437\u044f\u0442\u044c \u0438 \u043d\u0430\u043a\u0430\u0442\u0438\u0442\u044c \u0431\u044d\u043a\u0430\u043f\/\u0441\u043a\u0440\u0438\u043f\u0442 \u043e\u0434\u043d\u043e\u0439 \u0421\u0423\u0411\u0414 \u043d\u0430 \u0434\u0440\u0443\u0433\u0443\u044e.<\/p>\n<p>\u0417\u0430\u0434\u0430\u0447\u0430 \u043e\u0441\u043b\u043e\u0436\u043d\u044f\u043b\u0430\u0441\u044c \u0435\u0449\u0435 \u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c\u044e \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 150 \u0413\u0438\u0411 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 (\u0442\u0438\u043f\u044b GEOGRAPHY \u0438 GEOMETRY \u0438\u0437 MS SQL) \u0432 PostgreSQL.<\/p>\n<p>\u041d\u0430 \u0440\u044b\u043d\u043a\u0435 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0445\u0435\u043c\u0443 \u0438\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 MS SQL \u0432 PostgreSQL:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/aws.amazon.com\/rds\/aurora\/babelfish\/\" rel=\"noopener noreferrer nofollow\">Babelfish \u043e\u0442 AWS<\/a><\/p>\n<ul>\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u043f\u043b\u0430\u0433\u0438\u043d \u043d\u0430 PostgreSQL \u0438 \u0434\u0435\u043b\u0430\u0435\u0442 \u0435\u0433\u043e \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b\u043c \u0441 T-SQL \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u043e\u043c, \u0437\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u0443\u043c\u0430\u0442\u044c, \u0447\u0442\u043e \u043e\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 MS SQL.<\/p>\n<\/li>\n<li>\n<p>\u0412 \u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f, \u0434\u0430\u043d\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u043b\u043e\u0441\u044c \u043b\u0438\u0448\u044c \u043a\u0430\u043a \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e \u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u043d\u0430 PostgreSQL, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0438\u043c\u0435\u0435\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0432 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u0441 \u0421\u0423\u0411\u0414.<\/p>\n<\/li>\n<li>\n<p>Babelfish \u043f\u043e\u043a\u0430 \u0447\u0442\u043e\u00a0<a href=\"https:\/\/babelfishpg.org\/docs\/usage\/limitations-of-babelfish\/\" rel=\"noopener noreferrer nofollow\">\u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445<\/a>\u00a0GEOMETRY \u0438 GEOGRAPHY.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><a href=\"https:\/\/aws.amazon.com\/dms\/schema-conversion-tool\/\" rel=\"noopener noreferrer nofollow\">AWS Schema Conversion tool<\/a><\/p>\n<ul>\n<li>\n<p>\u0423\u0442\u0438\u043b\u0438\u0442\u0430 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 SQL-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0441\u043e \u0441\u0445\u0435\u043c\u043e\u0439 \u0411\u0414 \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0439 \u0421\u0423\u0411\u0414 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0434\u0440\u0443\u0433\u043e\u0439 \u0421\u0423\u0411\u0414.<\/p>\n<\/li>\n<li>\n<p>\u041c\u0438\u0433\u0440\u0438\u0440\u0443\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0447\u0435\u0440\u0435\u0437 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435\u00a0<a href=\"https:\/\/docs.aws.amazon.com\/SchemaConversionTool\/latest\/userguide\/agents.html\" rel=\"noopener noreferrer nofollow\">data extraction agents<\/a>.<\/p>\n<\/li>\n<li>\n<p>\u041c\u0438\u0433\u0440\u0430\u0446\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d\u0430 \u043d\u0430 \u043e\u0431\u043b\u0430\u043a\u043e AWS.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u0430\u0440\u0438\u0430\u0446\u0438\u0439 \u0443\u0442\u0438\u043b\u0438\u0442 \u043f\u043e, \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0438\u043c\u043f\u043e\u0440\u0442\u0443-\u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0443 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440,\u00a0<a href=\"https:\/\/gdal.org\/faq.html#what-is-this-ogr-stuff\" rel=\"noopener noreferrer nofollow\">ogr2ogr<\/a>.<\/p>\n<ul>\n<li>\n<p>\u0423\u0442\u0438\u043b\u0438\u0442\u0430 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0431\u044b \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u0432\u044b\u0433\u0440\u0443\u0437\u043a\u0438 \u0438\u0445 \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0442\u0438\u043f\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445, \u0447\u0442\u043e \u0443\u0441\u043b\u043e\u0436\u043d\u0438\u043b\u043e \u0431\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443.<\/p>\n<\/li>\n<li>\n<p>\u0427\u0430\u0441\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b\u0430 \u0431\u044b \u0442\u0430\u043a: MS SQL \u2192 \u0444\u0430\u0439\u043b \u0441 \u0433\u0435\u043e\u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u2192 PostgreSQL.<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0442\u0435\u0440\u043d\u0438\u0441\u0442\u044b\u0439 \u043f\u0443\u0442\u044c, \u043a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0443\u0442\u0438\u043b\u0438\u0442 \u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u043e \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0441\u0445\u0435\u043c \u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u0432\u0437\u0432\u0435\u0441\u0438\u0432 \u0438\u0445 \u043f\u043b\u044e\u0441\u044b \u0438 \u043c\u0438\u043d\u0443\u0441\u044b, \u0432\u0441\u0435 \u0436\u0435, \u0440\u0435\u0448\u0438\u043b\u0438 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0443\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435, Entity Framework, \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0439\u00a0<s>\u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434<\/s>\u00a0\u043c\u0438\u0433\u0440\u0430\u0442\u043e\u0440.<\/p>\n<h3>\u041e \u043f\u0440\u043e\u0435\u043a\u0442\u0435 Geography<\/h3>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441 \u0431\u044b\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u0435\u0449\u0435 \u0432 2016 \u0433\u043e\u0434\u0443, \u043e\u0441\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 .NET, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 MS SQL \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 Entity Framework \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 ORM.<\/p>\n<p>\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u0437\u0430\u0434 \u0431\u044b\u043b\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u043f\u043e\u0434 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u0420\u0435\u0435\u0441\u0442\u0440\u0430 \u043e\u0442\u0435\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u041f\u041e, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 &#8212; \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u0438 .NET, EF Core \u0438, \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 PostgreSQL.<\/p>\n<p>\u0421\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 .NET \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e\u0442 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u0443\u044e \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u044e\u00a0MIT, \u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0440\u043e\u0441\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 (\u043d\u0430 \u044d\u0442\u0443 \u0442\u0435\u043c\u0443 \u0435\u0441\u0442\u044c \u0446\u0435\u043b\u044b\u0439\u00a0<a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/performance_improvements_in_net_7\/\" rel=\"noopener noreferrer nofollow\">\u0446\u0438\u043a\u043b \u0441\u0442\u0430\u0442\u0435\u0439<\/a>) \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043d\u043e\u0432\u044b\u043c\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u0412 \u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f, PostgreSQL \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0432\u0435\u0440\u0441\u0438\u043e\u043d\u043d\u043e\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0445 &#171;\u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438&#187;, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u0440\u0435\u0448\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043e\u043a \u0443\u0440\u043e\u0432\u043d\u044f \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0439 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 (DML, \u043f\u0440\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0438 \u0448\u0442\u0430\u0442\u043d\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u0430), \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e\u0435 High Availability,\u00a0\u0432\u043f\u043b\u043e\u0442\u044c \u0434\u043e \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430, \u043d\u0435 \u0433\u043e\u0432\u043e\u0440\u044f \u0443\u0436\u0435 \u043e read only \u0438 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u0445.\u00a0\u0412 \u0434\u043e\u0431\u0430\u0432\u043e\u043a, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043f\u043e\u043b\u043d\u0443\u044e \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c \u0441\u043e \u0441\u0442\u0435\u043a\u043e\u043c Linux \u0438 \u0440\u0430\u0437\u0432\u0438\u0442\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e.\u00a0\u0414\u0430 \u0438 \u043a\u0442\u043e \u0436\u0435 \u043d\u0435 \u043b\u044e\u0431\u0438\u0442 \u043d\u043e\u0432\u044b\u0435 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438? \u0422\u0430\u043a\u043e\u0432 \u043f\u0443\u0442\u044c.<\/p>\n<p>\u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0438 Entity Framework Core \u0443\u0436\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0437\u0440\u0435\u043b\u0430\u044f ORM-\u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044f.<\/p>\n<h4>\u0421\u043e\u0441\u0442\u0430\u0432\u043d\u044b\u0435 \u0447\u0430\u0441\u0442\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u043a PosgtreSQL:<\/h4>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/170\/9b9\/8f1\/1709b98f1bb6372201b05d577306777b.png\" width=\"871\" height=\"647\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/170\/9b9\/8f1\/1709b98f1bb6372201b05d577306777b.png\"\/><figcaption><\/figcaption><\/figure>\n<ul>\n<li>\n<p>Api &#8212;\u00a0ASP .NET web API<\/p>\n<\/li>\n<li>\n<p>Api.Client &#8212;\u00a0\u041a\u043b\u0438\u0435\u043d\u0442 API<\/p>\n<\/li>\n<li>\n<p>Business Logic Services &#8212;\u00a0\u0421\u043b\u043e\u0439 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0438<\/p>\n<\/li>\n<li>\n<p>EF.Sql &#8212;\u00a0EF Core \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0411\u0414, \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0441\u0445\u0435\u043c\u044b \u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0411\u0414, \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438<\/p>\n<\/li>\n<li>\n<p>Migration utility &#8212; \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u0430\u044f \u0443\u0442\u0438\u043b\u0438\u0442\u0430 \u0434\u043b\u044f \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0439 \u0441\u0445\u0435\u043c\u044b \u0438 \u0434\u0430\u043d\u043d\u044b\u0445.\u00a0\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f CI\/CD.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u043e\u0435\u043a\u0442\u044b \u0441 \u0442\u0435\u0441\u0442\u0430\u043c\u0438 API, \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u043c\u0438 \u0442\u0435\u0441\u0442\u0430\u043c\u0438<\/p>\n<\/li>\n<\/ul>\n<h4>\u0422\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u0442\u0435\u043a<\/h4>\n<ul>\n<li>\n<p>.NET Core 3.1<\/p>\n<\/li>\n<li>\n<p>MS SQL Server 2016<\/p>\n<\/li>\n<li>\n<p>Entity Framework Core 5<\/p>\n<ul>\n<li>\n<p>\u0412\u0441\u0435 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437\u00a0<a href=\"https:\/\/learn.microsoft.com\/en-us\/ef\/core\/modeling\/entity-properties?tabs=data-annotations%2Cwithout-nrt\" rel=\"noopener noreferrer nofollow\">Data Annotations<\/a>.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>ASP .NET Core 3.1<\/p>\n<\/li>\n<li>\n<p>Autofac \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 DI-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430<\/p>\n<\/li>\n<\/ul>\n<h3>\u0420\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/h3>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430, \u0438\u0437 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u0411\u0414 \u0431\u044b\u043b\u043e \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043b\u043e\u0451\u0432:<\/p>\n<ul>\n<li>\n<p>C\u0443\u0449\u043d\u043e\u0441\u0442\u0438 EF \u0432 \u0432\u0438\u0434\u0435 POCO-\u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u0431\u0435\u0437 \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u0441\u0441\u044b\u043b\u043e\u043a \u043d\u0430 EF \u0438 \u0431\u0435\u0437 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0439\/\u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0438\u0445 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f, \u043a\u043b\u044e\u0447\u0438 \u0438 \u0441\u0432\u044f\u0437\u0438 \u043c\u0435\u0436\u0434\u0443 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044f\u043c\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b<\/p>\n<ul>\n<li>\n<p>\u0414\u043b\u044f \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 EF.<\/p>\n<\/li>\n<li>\n<p>\u0414\u043b\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 EF.<\/p>\n<\/li>\n<li>\n<p>\u0414\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f\/\u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0411\u0414, UnitOfWork\u00a0&#8212; \u0447\u0430\u0441\u0442\u044c \u0443\u043d\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u043a \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 Data Access Layer<\/p>\n<details class=\"spoiler\">\n<summary>\u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b \u0447\u0442\u0435\u043d\u0438\u044f\/\u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0411\u0414. \u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Fortis.Common.DAL<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cs\">\/\/ Copyright \u00a9 2022 \u041e\u041e\u041e \"\u0424\u043e\u0440\u0442\u0438\u0441\", \u0413\u041a \"\u041c\u043e\u043d\u043e\u043f\u043e\u043b\u0438\u044f\" namespace Fortis.Common.DataAccessLayer.Contracts;  \/\/\/ &lt;summary> \/\/\/ \u041f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0438\u0437 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 \/\/\/ \u0410\u0431\u0441\u0442\u0440\u0430\u0433\u0438\u0440\u043e\u0432\u0430\u043d \u043e\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0421\u0423\u0411\u0414 \u0438 ORM \/\/\/ &lt;\/summary> public interface IDbReader { \/\/\/ &lt;summary> \/\/\/ \u041f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0438\u0437 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 \/\/\/ &lt;\/summary> IQueryable&lt;TEntity> Read&lt;TEntity>() where TEntity : class, IDbEntity; }  \/\/\/ &lt;summary> \/\/\/ \u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0432 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \/\/\/ \u0410\u0431\u0441\u0442\u0440\u0430\u0433\u0438\u0440\u043e\u0432\u0430\u043d \u043e\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0421\u0423\u0411\u0414 \u0438 ORM \/\/\/ &lt;\/summary> public interface IDbWriter { \/\/\/ &lt;summary>\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u0437\u0430\u043f\u0438\u0441\u044c&lt;\/summary> void Add&lt;TEntity>(TEntity entity) where TEntity : class, IDbEntity;  \/\/\/ &lt;summary>\u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u044c&lt;\/summary> void Update&lt;TEntity>(TEntity entity) where TEntity : class, IDbEntity;  \/\/\/ &lt;summary>\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u044c&lt;\/summary> void Delete&lt;TEntity>(TEntity entity) where TEntity : class, IDbEntity; }  \/\/\/ &lt;summary>\u0421\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430&lt;\/summary> public interface IDbUnitOfWork { \/\/\/ &lt;summary>\u0410\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0432\u0441\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u0432 Db&lt;\/summary> \/\/\/ &lt;returns>\u0427\u0438\u0441\u043b\u043e \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438, \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0432 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445&lt;\/returns> Task&lt;int> SaveChangesAsync(CancellationToken cancellationToken);  \/\/\/ &lt;summary>\u0421\u043e\u0437\u0434\u0430\u0435\u0442 \u043d\u043e\u0432\u0443\u044e \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044e&lt;\/summary> IDbTransaction InTransaction(); }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cs\">\/\/ Copyright \u00a9 2022 \u041e\u041e\u041e \"\u0424\u043e\u0440\u0442\u0438\u0441\", \u0413\u041a \"\u041c\u043e\u043d\u043e\u043f\u043e\u043b\u0438\u044f\" using System.Linq;\u2028 using Fortis.Common.DataAccessLayer.Contracts;\u2028 using Fortis.GeographyEF.Abstract;\u2028 using Microsoft.EntityFrameworkCore;  namespace Fortis.GeographyEF;  partial class GeographyDbContext : IMsSqlGeographyDbReader, IMsSqlGeographyDbWriter, IDbUnitOfWork { void IDbWriter.Add&lt;TEntity>(TEntity entity) => Entry(entity).State = EntityState.Added;  void IDbWriter.Update&lt;TEntity>(TEntity entity) => base.Entry(entity).State = EntityState.Modified;  void IDbWriter.Delete&lt;TEntity>(TEntity entity) => base.Entry(entity).State = EntityState.Deleted;  IQueryable&lt;TEntity> IDbReader.Read&lt;TEntity>() => base.Set&lt;TEntity>() .AsNoTracking() .AsQueryable();  Task&lt;int> IDbUnitOfWork.SaveChangesWithoutAuditAsync(CancellationToken cancellationToken) => SaveChangesAsync(cancellationToken);  Task&lt;int> IDbUnitOfWork.SaveChangesAsync(CancellationToken cancellationToken) => SaveChangesWithDetachAsync(cancellationToken);  IDbUnitOfWork.IDbTransaction InTransaction() { var internalTransaction = Database.BeginTransaction(); return new GeographyDbTransaction(internalTransaction); }  \/\/\/ &lt;summary> \/\/\/ \u041c\u0435\u0442\u043e\u0434 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441 Detach \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439 \/\/\/ &lt;\/summary> internal async Task&lt;int> SaveChangesWithDetachAsync(CancellationToken cancellationToken) { var count = await base.SaveChangesAsync(cancellationToken); foreach (var entry in base.ChangeTracker.Entries().ToArray()) { entry.State = EntityState.Detached; }  return count; } }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul>\n<li>\n<p>\u0421\u0430\u043c DbContext \u0434\u043b\u044f MS SQL, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0438\u0439 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0432\u044b\u0448\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0435\u0433\u043e \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0438 Autofac-\u043c\u043e\u0434\u0443\u043b\u044c, \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0432 DI \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u044b\u0439 \u0432 web API \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438.<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u0434\u043b\u044f MS SQL \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435\u00a0<a href=\"https:\/\/learn.microsoft.com\/en-us\/ef\/core\/modeling\/\" rel=\"noopener noreferrer nofollow\">Fluent API Configuration<\/a><\/p>\n<ul>\n<li>\n<p>\u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446 \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 IEntityTypeConfiguration&lt;TEnity>.<\/p>\n<details class=\"spoiler\">\n<summary>\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cs\">\/\/ Copyright \u00a9 2022 \u041e\u041e\u041e \"\u0424\u043e\u0440\u0442\u0438\u0441\", \u0413\u041a \"\u041c\u043e\u043d\u043e\u043f\u043e\u043b\u0438\u044f\" namespace Fortis.GeographyEF.Entities.Configurations.MsSql; public class SettlementConfiguration : IEntityTypeConfiguration&lt;Settlement> {     public void Configure(EntityTypeBuilder&lt;Settlement> builder)     {     builder.ToTable(\"Settlements\");         builder.HasKey(p =&amp;gt; p.Id);         builder.Property(p =&amp;gt; p.Id).ValueGeneratedOnAdd();                   builder.Property(o =&amp;gt; o.Name)             .IsRequired()             .HasMaxLength(100)             .HasColumnType(\"NVARCHAR(100)\");         builder.Property(o =&amp;gt; o.Abbreviation)             .IsRequired()             .HasMaxLength(15)             .HasColumnType(\"NVARCHAR(15)\");              builder.HasOne(p =&amp;gt; p.Region)             .WithMany(p =&amp;gt; p.Settlements)             .HasForeignKey(p =&amp;gt; p.RegionId)             .OnDelete(DeleteBehavior.Cascade);     } }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<\/li>\n<li>\n<p>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0442\u0430\u043a\u043e\u0433\u043e \u0440\u043e\u0434\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0439 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u0411\u0414.<\/p>\n<details class=\"spoiler\">\n<summary>\u041f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0439 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cs\">\/\/ Copyright \u00a9 2022 \u041e\u041e\u041e \"\u0424\u043e\u0440\u0442\u0438\u0441\", \u0413\u041a \"\u041c\u043e\u043d\u043e\u043f\u043e\u043b\u0438\u044f\" namespace Fortis.GeographyEF; internal sealed class GeographyDbContext: DbContext, IGeographyDbContext {     \/\/...     protected override void OnModelCreating(ModelBuilder builder)     {         base.OnModelCreating(builder);              builder.ApplyConfigurationsFromAssembly(typeof(SettlementConfiguration).Assembly);     } }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u0421\u043b\u043e\u0439 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0435\u0432, \u0437\u0430\u0432\u0438\u0441\u044f\u0449\u0438\u0445 \u043d\u0435 \u043e\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430, \u0430 \u043e\u0442 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0438 (\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430).<\/p>\n<\/li>\n<\/ul>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0430\u0441\u044c \u0431\u043e\u043b\u0435\u0435 \u043a\u0440\u0430\u0441\u0438\u0432\u0430\u044f \u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u043c\u0430\u044f \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u043b\u043e\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u043e\u0442\u043a\u0440\u044b\u0432\u0448\u0430\u044f \u043f\u0443\u0442\u044c \u043a \u0430\u0431\u0441\u0442\u0440\u0430\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e \u043e\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 Entity Framework \u043f\u043e\u0434 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0443\u044e \u0421\u0423\u0411\u0414.<\/p>\n<h4>\u0421\u043e\u0441\u0442\u0430\u0432\u043d\u044b\u0435 \u0447\u0430\u0441\u0442\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043f\u043e\u0441\u043b\u0435 \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430<\/h4>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/43d\/c90\/b29\/43dc90b291276273ef4d6b0d25be71b1.png\" width=\"871\" height=\"647\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/43d\/c90\/b29\/43dc90b291276273ef4d6b0d25be71b1.png\"\/><figcaption><\/figcaption><\/figure>\n<h4>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c PostgreSQL<\/h4>\n<p>\u041d\u0430 \u0434\u0430\u043d\u043d\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0431\u044b\u043b\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043e \u0435\u0449\u0435 \u0434\u0432\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u0440\u0430\u043d\u0435\u0435 \u0434\u043b\u044f MS SQL:<\/p>\n<ul>\n<li>\n<p>DbContext \u0434\u043b\u044f PostgreSQL, \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0441\u0445\u0435\u043c\u044b \u0438 Autofac-\u043c\u043e\u0434\u0443\u043b\u044c.<\/p>\n<ul>\n<li>\n<p>\u0418\u043d\u0438\u0446\u0438\u0438\u0440\u0443\u044e\u0449\u0443\u044e \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044e \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0442\u0443\u0442 \u0436\u0435.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 PostgreSQL \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 Fluent API Configuration.<\/p>\n<\/li>\n<\/ul>\n<h4>\u0421\u043e\u0441\u0442\u0430\u0432\u043d\u044b\u0435 \u0447\u0430\u0441\u0442\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043f\u043e\u0441\u043b\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f PostgreSQL<\/h4>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/329\/16b\/f6e\/32916bf6e831d9c26d8848c92de122a2.png\" width=\"871\" height=\"647\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/329\/16b\/f6e\/32916bf6e831d9c26d8848c92de122a2.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0430\u043a\u0436\u0435, \u0434\u043b\u044f web api \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 Startup-\u043a\u043b\u0430\u0441\u0441\u0430, \u0431\u044b\u043b\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043e \u0447\u0442\u0435\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0438\u0437 IConfiguration, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u043d\u0443\u0436\u043d\u044b\u0439 \u043d\u0430\u043c Autofac-\u043c\u043e\u0434\u0443\u043b\u044c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u0411\u0414.\u00a0<\/p>\n<p>\u0422.\u0435. \u0442\u043e, \u043a\u0430\u043a\u0430\u044f \u0421\u0423\u0411\u0414 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0430, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0441\u0430\u043c\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.\u00a0<\/p>\n<p>\u041d\u0435 \u043e\u0431\u043e\u0448\u043b\u043e\u0441\u044c \u0438 \u0431\u0435\u0437 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0441\u0430\u043c\u043e\u0439 PostgreSQL &#8212; \u0431\u044b\u043b\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435\u00a0<a href=\"https:\/\/postgis.net\/install\/#binary-installers\" rel=\"noopener noreferrer nofollow\">PostGIS<\/a>, \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0435\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0421\u0423\u0411\u0414.<\/p>\n<h3>\u041c\u0438\u0433\u0440\u0430\u0446\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 PostgreSQL<\/h3>\n<p>\u0421\u0445\u0435\u043c\u0430 \u0434\u0435\u043f\u043b\u043e\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u0430 Geography \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435-\u043c\u0438\u0433\u0440\u0430\u0442\u043e\u0440 \u0434\u043b\u044f \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0441\u0445\u0435\u043c\u044b \u0411\u0414. \u0411\u044b\u043b\u043e \u0440\u0435\u0448\u0435\u043d\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u0442\u044c \u0435\u0433\u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0430\u043a\u0442\u0438\u0432\u043d\u0443\u044e \u0421\u0423\u0411\u0414 (MS SQL \u0438\u043b\u0438 PostgreSQL), \u0430 \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>\u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0443\u0436\u0435 \u0438\u043c\u0435\u043b\u0430\u0441\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u0430\u044f \u0440\u0430\u043d\u0435\u0435 \u0438\u043d\u0438\u0446\u0438\u0438\u0440\u0443\u044e\u0449\u0430\u044f \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044f \u0434\u043b\u044f PostgreSQL, \u043e\u043d\u0430 \u0431\u044b\u043b\u0430 \u0440\u0430\u0437\u0432\u0451\u0440\u043d\u0443\u0442\u0430 \u043d\u0430 \u043f\u0443\u0441\u0442\u0443\u044e \u0431\u0430\u0437\u0443 \u0438 \u0432\u0437\u044f\u0442\u0430 \u0437\u0430 \u043e\u0441\u043d\u043e\u0432\u0443 \u0434\u043b\u044f \u0431\u0443\u0434\u0443\u0449\u0438\u0445 \u0434\u0435\u043f\u043b\u043e\u0435\u0432.<\/p>\n<p>\u0414\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0432\u0441\u0435\u0445 150\u0413\u0438\u0411\u00a0\u0434\u0430\u043d\u043d\u044b\u0445 (\u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u0430\u0431\u043b\u0438\u0446 \u043f\u043e ~10\u043c\u043b\u043d \u0437\u0430\u043f\u0438\u0441\u0435\u0439, \u043d\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043e\u0431\u044a\u0435\u043c &#8212; \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u043f\u043e\u043b\u044f\u0445 \u0441 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c\u0438 \u0442\u0438\u043f\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445), \u0431\u044b\u043b\u043e \u0440\u0435\u0448\u0435\u043d\u043e \u043f\u043e\u0439\u0442\u0438 \u043f\u043e \u043f\u0443\u0442\u0438 \u043e\u0431\u0445\u043e\u0434\u0430 \u043a\u0430\u0436\u0434\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0438\u0437 EF-\u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 MS SQL \u0438 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 PostgreSQL.<\/p>\n<p>\u0421 \u044d\u0442\u0438\u043c \u043f\u043e\u043c\u043e\u0433 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0442\u043e\u043f\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0441\u043e \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0435\u0439\u00a0<a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%9F%D0%BE%D0%B8%D1%81%D0%BA_%D0%B2_%D0%B3%D0%BB%D1%83%D0%B1%D0%B8%D0%BD%D1%83\" rel=\"noopener noreferrer nofollow\">\u043f\u043e\u0438\u0441\u043a\u0430 \u0432 \u0433\u043b\u0443\u0431\u0438\u043d\u0443<\/a>\u00a0\u0434\u043b\u044f \u043e\u0431\u0445\u043e\u0434\u0430 \u0432\u0441\u0435\u0445 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439 \u0411\u0414 \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043e\u0434\u043d\u043e\u043a\u0440\u0430\u0442\u043d\u043e \u043f\u0440\u043e\u0439\u0442\u0438\u0441\u044c \u043f\u043e \u0432\u0441\u0435\u043c \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044f\u043c \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u0438\u0445 \u0432\u0437\u0430\u0438\u043c\u043e\u0441\u0432\u044f\u0437\u0435\u0439 &#8212; \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u044b\u0433\u0440\u0443\u0436\u0430\u044e\u0442\u0441\u044f \u0432\u0441\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438, \u0430 \u0437\u0430\u0442\u0435\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0435 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438.<\/p>\n<details class=\"spoiler\">\n<summary>\u041f\u0440\u0438\u043c\u0435\u0440 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0442\u043e\u043f\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cs\">\/\/ Copyright \u00a9 2022 \u041e\u041e\u041e \"\u0424\u043e\u0440\u0442\u0438\u0441\", \u0413\u041a \"\u041c\u043e\u043d\u043e\u043f\u043e\u043b\u0438\u044f\" using System; using System.Collections.Generic; using System.Reflection; using NetTopologySuite.Geometries;  namespace Fortis.Geography.Migrate.DbSync;  internal sealed class TopSortService : ITopSortService { private static readonly HashSet&lt;Type> excludedTypes = new HashSet&lt;Type> { typeof(string), \/\/ don't analyze string properties typeof(Geometry), \/\/ and Geometry types typeof(LineString), };  public IEnumerable&lt;Type> Sort(IEnumerable&lt;Type> typesList) { var graph = new Dictionary&lt;Type, List&lt;Type>>(); foreach (var vertex in typesList) { var edges = new List&lt;Type>(); graph.Add(vertex, edges); foreach (var propertyInfo in vertex.GetProperties(BindingFlags.Public | BindingFlags.Instance)) { var edge = propertyInfo.PropertyType; if (!edge.IsValueType &amp;&amp; \/\/ don't analyze primitive types !edge.IsGenericType &amp;&amp; \/\/ and generic types !excludedTypes.Contains(edge)    ) { edges.Add(edge); } } }  var result = new List&lt;Type>(); var visited = new HashSet&lt;Type>(); foreach (var vertex in graph.Keys) { Dfs(vertex, graph, visited, result); }  return result; }  private static void Dfs( Type vertex, Dictionary&lt;Type, List&lt;Type>> graph, HashSet&lt;Type> visited, List&lt;Type> result) { if (!visited.Add(vertex)) { return; }  foreach (var edge in graph[vertex]) { Dfs(edge, graph, visited, result); }  result.Add(vertex); } }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0414\u0430\u043b\u0435\u0435, \u0431\u044b\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u0441\u0430\u043c \u043a\u043e\u0434 \u043c\u0438\u0433\u0440\u0430\u0442\u043e\u0440\u0430.<\/p>\n<details class=\"spoiler\">\n<summary>\u041f\u0440\u0438\u043c\u0435\u0440 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u0438\u0433\u0440\u0430\u0442\u043e\u0440\u0430<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cs\">\/\/ Copyright \u00a9 2022 \u041e\u041e\u041e \"\u0424\u043e\u0440\u0442\u0438\u0441\", \u0413\u041a \"\u041c\u043e\u043d\u043e\u043f\u043e\u043b\u0438\u044f\" using System; using System.Linq; using System.Reflection; using System.Threading; using System.Threading.Tasks; using Fortis.Common.DataAccessLayer.Entity.Contracts; using Fortis.Common.Logging.Contracts; using Fortis.GeographyEF.Abstract; using Fortis.GeographyEF.Common; using Fortis.GeographyEF.PostgreSql.Abstract; using Microsoft.EntityFrameworkCore;  namespace Fortis.Geography.Migrate.DbSync;  internal sealed class DbSynchronizationService : IDbSynchronizationService { private static readonly MethodInfo synchronizeEntityMethodInfo = typeof(DbSynchronizationService).GetMethod(nameof(SynchronizeEntities));  private readonly ITopSortService topSortService; private readonly IMsSqlGeographyDbReader msReader; private readonly IGeographyEntitiesResolver entitiesResolver; private readonly IPgGeographyDbWriter pgWriter; private readonly IPgGeographyDbUnitOfWork pgUnitOfWork; private readonly IFortisLogger logger;  public DbSynchronizationService( ITopSortService topSortService, IMsSqlGeographyDbReader msReader, IGeographyEntitiesResolver entitiesResolver, IPgGeographyDbWriter pgWriter, IPgGeographyDbUnitOfWork pgUnitOfWork, IFortisLogManager logManager) { logger = logManager.GetLogger&lt;DbSynchronizationService>();  this.topSortService = topSortService; this.msReader = msReader; this.entitiesResolver = entitiesResolver; this.pgWriter = pgWriter; this.pgUnitOfWork = pgUnitOfWork; }  async Task IDbSynchronizationService.Synchronize(CancellationToken cancellationToken) { var dbTypes = entitiesResolver.GetClrTypes(); var sortedDbTypes = topSortService.Sort(dbTypes); foreach (var dbType in sortedDbTypes) { await (Task)synchronizeEntityMethodInfo .MakeGenericMethod(dbType) .Invoke(this, new object[] {cancellationToken}); } }  \/\/ don't change modifier, because we use reflection public async Task SynchronizeEntities&lt;T>(CancellationToken token) where T : class, IDbEntity, ICreatedAtEntity, IEntityWithId { const int batchSize = 4024;  var baseMsQuery = msReader.Read&lt;T>();  var recordsTotal = await baseMsQuery.CountAsync(token); var recordsProcessed = 0;  logger.Info($\"Synchronizing {typeof(T).Name}. Total records: {recordsTotal}\");  try { while (recordsProcessed &lt; recordsTotal) { var srcList = await baseMsQuery .Skip(recordsProcessed) .Take(batchSize) .ToListAsync(token);  foreach (var entity in srcList) { pgWriter.Add(entity); }  await pgUnitOfWork.SaveChangesAsync(token);  recordsProcessed += srcList.Count; } } catch (Exception e) { logger.Error($\"{typeof(T).Name} synchronization failed. Processed records: {recordsProcessed}.\", e); throw; }  logger.Info($\"{typeof(T).Name} has been synchronized.\"); } }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0412 \u043a\u043b\u0430\u0441\u0441 \u043c\u0438\u0433\u0440\u0430\u0442\u043e\u0440\u0430 \u0438\u043d\u0436\u0435\u043a\u0442\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043d\u0435 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u044b \u0411\u0414, \u043d\u043e \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0438 \u043d\u0430\u0434 \u043d\u0438\u043c\u0438 (\u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f, \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u0438 UnitOfWork). \u0421\u0442\u043e\u0438\u0442 \u0438 \u0443\u0442\u043e\u0447\u043d\u0438\u0442\u044c \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 IGeographyEntitiesResolver &#8212; \u044d\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0439 \u0441\u043f\u0438\u0441\u043e\u043a CLR \u0442\u0438\u043f\u043e\u0432, \u0430\u0441\u0441\u043e\u0446\u0438\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0441 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043e\u043c.<\/p>\n<details class=\"spoiler\">\n<summary>\u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 IGeographyEntitiesResolver \u0438 \u0435\u0433\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cs\">\/\/ Copyright \u00a9 2022 \u041e\u041e\u041e \"\u0424\u043e\u0440\u0442\u0438\u0441\", \u0413\u041a \"\u041c\u043e\u043d\u043e\u043f\u043e\u043b\u0438\u044f\" public interface IGeographyEntitiesResolver { \/\/\/ &lt;summary> \/\/\/ \u0412\u0435\u0440\u043d\u0443\u0442\u044c \u0432\u0441\u0435 \u0430\u0441\u0441\u043e\u0446\u0438\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0441 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043e\u043c \u0411\u0414 CLR-\u0442\u0438\u043f\u044b \/\/\/ &lt;\/summary> IReadOnlyCollection&lt;Type> GetClrTypes(); }  partial class PgGeographyContext : IGeographyEntitiesResolver { private static readonly Assembly entitiesAssembly = typeof(Location).Assembly;  IReadOnlyCollection&lt;Type> IGeographyEntitiesResolver.GetClrTypes() => Model.GetEntityTypes() .Select(o => o.ClrType) .Where(o => o.Assembly == entitiesAssembly) .ToList(); }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u041e\u0442\u043c\u0435\u0447\u0443 \u0441\u0440\u0430\u0437\u0443, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u0438\u0433\u0440\u0430\u0442\u043e\u0440\u0430 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0430\u043d\u0430\u0446\u0435\u0435\u0439 \u0438 \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439 \u0432\u0430\u0448\u0438\u0445 \u0411\u0414. \u041c\u0438\u0433\u0440\u0430\u0442\u043e\u0440 \u0438\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b\u0441\u044f \u0434\u043b\u044f \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439, \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439, \u043a\u043e\u043f\u0438\u0438 \u0411\u0414 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f.\u00a0<\/p>\n<p>\u0421\u0430\u043c\u043e \u0441\u043e\u0431\u043e\u0439, \u0447\u0442\u043e \u0441 \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044f \u043f\u0435\u0440\u0432\u043e\u0439 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 PostgreSQL,\u00a0\u0411\u0414 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f \u043f\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u0441\u0442\u0440\u043e\u043a \u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043a\u043e\u043c\u043f\u0435\u043d\u0441\u0430\u0446\u0438\u0438 \u0440\u0430\u0441\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0439.<\/p>\n<p>\u0417\u0430\u0434\u0430\u0447\u0430 \u043e\u0431\u043b\u0435\u0433\u0447\u0430\u043b\u0430\u0441\u044c \u0442\u0435\u043c, \u0447\u0442\u043e \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 Geography \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e \u0433\u043e\u0440\u043e\u0434\u0430\u043c, \u0442\u043e\u0447\u043a\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0430 \u0438 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0430\u043c. \u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 &#8212; \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0435\u0440\u0435\u0437 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 EF-\u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0431\u044b\u043b\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043e\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u044b\u0441\u044f\u0447 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u044e\u0449\u0438\u0445 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u0440\u0435\u043b\u0438\u0437\u0430 \u0441 \u043e\u043a\u043e\u043d\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043e\u043c \u043a PostgreSQL &#8212; \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432 \u043a\u043e\u0434 \u043c\u0438\u0433\u0440\u0430\u0442\u043e\u0440\u0430 \u0431\u044b\u043b\u0438 \u0432\u043d\u0435\u0441\u0435\u043d\u044b \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0432\u044b\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0438 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u043e\u0432\u044b\u0445 \u0441\u0442\u0440\u043e\u043a. \u0412 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0434\u0435\u043f\u043b\u043e\u044f \u0431\u044b\u043b \u0432\u044b\u0437\u0432\u0430\u043d \u043c\u0438\u0433\u0440\u0430\u0442\u043e\u0440 \u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043e\u0430\u043a\u0442\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0437\u0430 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u0432\u0440\u0435\u043c\u044f.<\/p>\n<p>\u0414\u0430, \u0431\u044b\u043b\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b \u0438 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0439 \u043a\u043e\u043c\u043f\u0435\u043d\u0441\u0430\u0446\u0438\u0438 \u0440\u0430\u0441\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0439 \u0434\u0430\u043d\u043d\u044b\u0445:<\/p>\n<ul>\n<li>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u043e\u0431\u0435 \u0421\u0423\u0411\u0414 \u0447\u0435\u0440\u0435\u0437 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438.<\/p>\n<\/li>\n<li>\n<p>\u041e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0442\u0440\u0438\u0433\u0433\u0435\u0440\u043e\u0432 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u0445 \u0438 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435 \u043e\u0431 \u044d\u0442\u043e\u043c \u0447\u0435\u0440\u0435\u0437 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e Outbox-\u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430.<\/p>\n<\/li>\n<li>\n<p>\u0438 \u0442.\u0434.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412\u0441\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0438\u043c\u0435\u044e\u0442 \u0441\u0432\u043e\u0438 \u043f\u043b\u044e\u0441\u044b \u0438 \u043c\u0438\u043d\u0443\u0441\u044b \u0438  \u0431\u044b\u043b \u0432\u044b\u0431\u0440\u0430\u043d \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438.<\/p>\n<h3>\u0418\u0442\u043e\u0433\u0438<\/h3>\n<p>\u0421\u0435\u0440\u0432\u0438\u0441 Geography \u0431\u044b\u043b \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043c\u0438\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043d \u043d\u0430 \u043d\u043e\u0432\u0443\u044e \u0421\u0423\u0411\u0414 \u0431\u0435\u0437 \u043f\u043e\u0442\u0435\u0440\u044c, \u0441\u043e\u043f\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433 \u0443\u043b\u0443\u0447\u0448\u0438\u043b \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043d\u0435 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u0442\u0441\u044f.<\/p>\n<p>\u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043f\u043e\u0434\u0445\u043e\u0434 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c EF \u0438 \u0442\u043e\u043f\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u043e\u0439 \u043f\u043e\u043a\u0430\u0437\u0430\u043b \u0441\u0432\u043e\u044e \u0441\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c, \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u0435\u0433\u043e, \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u043a\u0430\u043c\u0438, \u0438 \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445.<\/p>\n<p>\u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0435 \u0432\u044b\u0448\u0435 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0432\u0430\u043c \u0432 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0435 \u0441 MS SQL \u043d\u0430 PostgreSQL. \u0415\u0441\u043b\u0438 \u043e\u0441\u0442\u0430\u043b\u0438\u0441\u044c \u0432\u043e\u043f\u0440\u043e\u0441\u044b, welcome \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/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\/post\/701060\/\"> https:\/\/habr.com\/ru\/post\/701060\/<\/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<h3>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430<\/h3>\n<p>\u041d\u0435 \u0441\u0435\u043a\u0440\u0435\u0442, \u0447\u0442\u043e \u0442\u0435\u043c\u0430 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u0432 IT-\u0441\u0444\u0435\u0440\u0435 \u043d\u0430 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438, \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u044e\u0449\u0438\u0435 \u0434\u043e\u0440\u043e\u0433\u043e\u0441\u0442\u043e\u044f\u0449\u0435\u0433\u043e \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0432\u0441\u0451 \u0431\u043e\u043b\u0435\u0435 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439. \u0412 \u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f, \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e \u0438 \u0441\u0442\u0440\u0435\u043c\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0439 \u043f\u043e\u043f\u0430\u0441\u0442\u044c \u0432 \u0420\u0435\u0435\u0441\u0442\u0440 \u043e\u0442\u0435\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u041f\u041e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0440\u0430\u0437\u043d\u043e\u0433\u043e \u0440\u043e\u0434\u0430 \u043f\u0440\u0435\u0444\u0435\u0440\u0435\u043d\u0446\u0438\u0438 \u0434\u043b\u044f \u0441\u0435\u0431\u044f \u0438 \u0441\u0432\u043e\u0438\u0445 \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a\u043e\u0432.<\/p>\n<p>\u0421 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0441\u0442\u0435\u043a\u0430, \u043c\u044b \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438\u0441\u044c\u00a0<a href=\"https:\/\/ru-ikt.ru\/metodicheskiye_rekomendatsi\/\" rel=\"noopener noreferrer nofollow\">\u043c\u0435\u0442\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u044f\u043c\u0438 \u0420\u0435\u0435\u0441\u0442\u0440\u0430 \u043e\u0442\u0435\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u041f\u041e<\/a>\u00a0\u0438 \u043f\u0440\u0438\u043d\u044f\u043b\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043e \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0435 \u043d\u0430\u0448\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u043d\u0430 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438 \u0441\u043e \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u043c\u0438 \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u044f\u043c\u0438, \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438 .NET 6\u00a0\u0438 PostgreSQL. \u042d\u0442\u043e \u043e\u0442\u043a\u0440\u044b\u043b\u043e \u043d\u0430\u043c \u043f\u0443\u0442\u044c \u043a\u0430\u043a \u043a \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0438 \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u044e \u0440\u0430\u0441\u0445\u043e\u0434\u043e\u0432 \u043d\u0430 \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u0442\u0430\u043a \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044e \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u0432 \u0440\u0435\u0435\u0441\u0442\u0440.<\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043f\u0443\u0442\u044c \u043f\u043e \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0433\u0435\u043e\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0441 MS SQL \u043d\u0430 PostgreSQL \u0441 \u0444\u043e\u043a\u0443\u0441\u043e\u043c \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 (spatial) \u0442\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>\u0412\u043e\u043f\u0440\u043e\u0441 \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u0438 \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u0439 \u0438 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f MS SQL vs PostgreSQL \u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0442.\u043a. \u044d\u0442\u0430 \u0442\u0435\u043c\u0430 \u0432\u0435\u0441\u044c\u043c\u0430 \u0445\u043e\u0440\u043e\u0448\u043e \u0440\u0430\u0441\u043a\u0440\u044b\u0442\u0430 \u0432\u00a0<a href=\"https:\/\/www.youtube.com\/watch?v=3DcCX89Mz78\" rel=\"noopener noreferrer nofollow\">DotNext-\u0434\u043e\u043a\u043b\u0430\u0434\u0435<\/a>\u00a0\u043c\u043e\u0435\u0433\u043e \u043a\u043e\u043b\u043b\u0435\u0433\u0438, \u0421\u0442\u0430\u043d\u0438\u0441\u043b\u0430\u0432\u0430 \u0424\u043b\u0443\u0441\u043e\u0432\u0430 (<a class=\"mention\" href=\"\/users\/stus\">@stus<\/a>). \u0420\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u043a \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0443!<\/p>\n<h3>\u041f\u0443\u0442\u0438 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438<\/h3>\n<p>\u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0442\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 MS SQL \u0438 PostgreSQL \u0437\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u0438\u043c\u0435\u044e\u0442 \u0441\u0432\u043e\u0438 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438, \u043d\u0435\u043b\u044c\u0437\u044f \u043f\u0440\u043e\u0441\u0442\u043e \u0442\u0430\u043a \u0432\u0437\u044f\u0442\u044c \u0438 \u043d\u0430\u043a\u0430\u0442\u0438\u0442\u044c \u0431\u044d\u043a\u0430\u043f\/\u0441\u043a\u0440\u0438\u043f\u0442 \u043e\u0434\u043d\u043e\u0439 \u0421\u0423\u0411\u0414 \u043d\u0430 \u0434\u0440\u0443\u0433\u0443\u044e.<\/p>\n<p>\u0417\u0430\u0434\u0430\u0447\u0430 \u043e\u0441\u043b\u043e\u0436\u043d\u044f\u043b\u0430\u0441\u044c \u0435\u0449\u0435 \u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c\u044e \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 150 \u0413\u0438\u0411 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 (\u0442\u0438\u043f\u044b GEOGRAPHY \u0438 GEOMETRY \u0438\u0437 MS SQL) \u0432 PostgreSQL.<\/p>\n<p>\u041d\u0430 \u0440\u044b\u043d\u043a\u0435 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0445\u0435\u043c\u0443 \u0438\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 MS SQL \u0432 PostgreSQL:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/aws.amazon.com\/rds\/aurora\/babelfish\/\" rel=\"noopener noreferrer nofollow\">Babelfish \u043e\u0442 AWS<\/a><\/p>\n<ul>\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u043f\u043b\u0430\u0433\u0438\u043d \u043d\u0430 PostgreSQL \u0438 \u0434\u0435\u043b\u0430\u0435\u0442 \u0435\u0433\u043e \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b\u043c \u0441 T-SQL \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u043e\u043c, \u0437\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u0443\u043c\u0430\u0442\u044c, \u0447\u0442\u043e \u043e\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 MS SQL.<\/p>\n<\/li>\n<li>\n<p>\u0412 \u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f, \u0434\u0430\u043d\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u043b\u043e\u0441\u044c \u043b\u0438\u0448\u044c \u043a\u0430\u043a \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e \u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u043d\u0430 PostgreSQL, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0438\u043c\u0435\u0435\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0432 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u0441 \u0421\u0423\u0411\u0414.<\/p>\n<\/li>\n<li>\n<p>Babelfish \u043f\u043e\u043a\u0430 \u0447\u0442\u043e\u00a0<a href=\"https:\/\/babelfishpg.org\/docs\/usage\/limitations-of-babelfish\/\" rel=\"noopener noreferrer nofollow\">\u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445<\/a>\u00a0GEOMETRY \u0438 GEOGRAPHY.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><a href=\"https:\/\/aws.amazon.com\/dms\/schema-conversion-tool\/\" rel=\"noopener noreferrer nofollow\">AWS Schema Conversion tool<\/a><\/p>\n<ul>\n<li>\n<p>\u0423\u0442\u0438\u043b\u0438\u0442\u0430 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 SQL-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0441\u043e \u0441\u0445\u0435\u043c\u043e\u0439 \u0411\u0414 \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0439 \u0421\u0423\u0411\u0414 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0434\u0440\u0443\u0433\u043e\u0439 \u0421\u0423\u0411\u0414.<\/p>\n<\/li>\n<li>\n<p>\u041c\u0438\u0433\u0440\u0438\u0440\u0443\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0447\u0435\u0440\u0435\u0437 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435\u00a0<a href=\"https:\/\/docs.aws.amazon.com\/SchemaConversionTool\/latest\/userguide\/agents.html\" rel=\"noopener noreferrer nofollow\">data extraction agents<\/a>.<\/p>\n<\/li>\n<li>\n<p>\u041c\u0438\u0433\u0440\u0430\u0446\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d\u0430 \u043d\u0430 \u043e\u0431\u043b\u0430\u043a\u043e AWS.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u0430\u0440\u0438\u0430\u0446\u0438\u0439 \u0443\u0442\u0438\u043b\u0438\u0442 \u043f\u043e, \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0438\u043c\u043f\u043e\u0440\u0442\u0443-\u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0443 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440,\u00a0<a href=\"https:\/\/gdal.org\/faq.html#what-is-this-ogr-stuff\" rel=\"noopener noreferrer nofollow\">ogr2ogr<\/a>.<\/p>\n<ul>\n<li>\n<p>\u0423\u0442\u0438\u043b\u0438\u0442\u0430 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0431\u044b \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u0432\u044b\u0433\u0440\u0443\u0437\u043a\u0438 \u0438\u0445 \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0442\u0438\u043f\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445, \u0447\u0442\u043e \u0443\u0441\u043b\u043e\u0436\u043d\u0438\u043b\u043e \u0431\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443.<\/p>\n<\/li>\n<li>\n<p>\u0427\u0430\u0441\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b\u0430 \u0431\u044b \u0442\u0430\u043a: MS SQL \u2192 \u0444\u0430\u0439\u043b \u0441 \u0433\u0435\u043e\u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u2192 PostgreSQL.<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0442\u0435\u0440\u043d\u0438\u0441\u0442\u044b\u0439 \u043f\u0443\u0442\u044c, \u043a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0443\u0442\u0438\u043b\u0438\u0442 \u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u043e \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0441\u0445\u0435\u043c \u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u0432\u0437\u0432\u0435\u0441\u0438\u0432 \u0438\u0445 \u043f\u043b\u044e\u0441\u044b \u0438 \u043c\u0438\u043d\u0443\u0441\u044b, \u0432\u0441\u0435 \u0436\u0435, \u0440\u0435\u0448\u0438\u043b\u0438 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0443\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435, Entity Framework, \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0439\u00a0<s>\u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434<\/s>\u00a0\u043c\u0438\u0433\u0440\u0430\u0442\u043e\u0440.<\/p>\n<h3>\u041e \u043f\u0440\u043e\u0435\u043a\u0442\u0435 Geography<\/h3>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441 \u0431\u044b\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u0435\u0449\u0435 \u0432 2016 \u0433\u043e\u0434\u0443, \u043e\u0441\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 .NET, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 MS SQL \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 Entity Framework \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 ORM.<\/p>\n<p>\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u0437\u0430\u0434 \u0431\u044b\u043b\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u043f\u043e\u0434 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u0420\u0435\u0435\u0441\u0442\u0440\u0430 \u043e\u0442\u0435\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u041f\u041e, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 &#8212; \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u0438 .NET, EF Core \u0438, \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 PostgreSQL.<\/p>\n<p>\u0421\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 .NET \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e\u0442 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u0443\u044e \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u044e\u00a0MIT, \u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0440\u043e\u0441\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 (\u043d\u0430 \u044d\u0442\u0443 \u0442\u0435\u043c\u0443 \u0435\u0441\u0442\u044c \u0446\u0435\u043b\u044b\u0439\u00a0<a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/performance_improvements_in_net_7\/\" rel=\"noopener noreferrer nofollow\">\u0446\u0438\u043a\u043b \u0441\u0442\u0430\u0442\u0435\u0439<\/a>) \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043d\u043e\u0432\u044b\u043c\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u0412 \u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f, PostgreSQL \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0432\u0435\u0440\u0441\u0438\u043e\u043d\u043d\u043e\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0445 &#171;\u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438&#187;, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u0440\u0435\u0448\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043e\u043a \u0443\u0440\u043e\u0432\u043d\u044f \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0439 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 (DML, \u043f\u0440\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0438 \u0448\u0442\u0430\u0442\u043d\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u0430), \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e\u0435 High Availability,\u00a0\u0432\u043f\u043b\u043e\u0442\u044c \u0434\u043e \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430, \u043d\u0435 \u0433\u043e\u0432\u043e\u0440\u044f \u0443\u0436\u0435 \u043e read only \u0438 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u0445.\u00a0\u0412 \u0434\u043e\u0431\u0430\u0432\u043e\u043a, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043f\u043e\u043b\u043d\u0443\u044e \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c \u0441\u043e \u0441\u0442\u0435\u043a\u043e\u043c Linux \u0438 \u0440\u0430\u0437\u0432\u0438\u0442\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e.\u00a0\u0414\u0430 \u0438 \u043a\u0442\u043e \u0436\u0435 \u043d\u0435 \u043b\u044e\u0431\u0438\u0442 \u043d\u043e\u0432\u044b\u0435 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438? \u0422\u0430\u043a\u043e\u0432 \u043f\u0443\u0442\u044c.<\/p>\n<p>\u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0438 Entity Framework Core \u0443\u0436\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0437\u0440\u0435\u043b\u0430\u044f ORM-\u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044f.<\/p>\n<h4>\u0421\u043e\u0441\u0442\u0430\u0432\u043d\u044b\u0435 \u0447\u0430\u0441\u0442\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u043a PosgtreSQL:<\/h4>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<ul>\n<li>\n<p>Api &#8212;\u00a0ASP .NET web API<\/p>\n<\/li>\n<li>\n<p>Api.Client &#8212;\u00a0\u041a\u043b\u0438\u0435\u043d\u0442 API<\/p>\n<\/li>\n<li>\n<p>Business Logic Services &#8212;\u00a0\u0421\u043b\u043e\u0439 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0438<\/p>\n<\/li>\n<li>\n<p>EF.Sql &#8212;\u00a0EF Core \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0411\u0414, \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0441\u0445\u0435\u043c\u044b \u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0411\u0414, \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438<\/p>\n<\/li>\n<li>\n<p>Migration utility &#8212; \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u0430\u044f \u0443\u0442\u0438\u043b\u0438\u0442\u0430 \u0434\u043b\u044f \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0439 \u0441\u0445\u0435\u043c\u044b \u0438 \u0434\u0430\u043d\u043d\u044b\u0445.\u00a0\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f CI\/CD.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u043e\u0435\u043a\u0442\u044b \u0441 \u0442\u0435\u0441\u0442\u0430\u043c\u0438 API, \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u043c\u0438 \u0442\u0435\u0441\u0442\u0430\u043c\u0438<\/p>\n<\/li>\n<\/ul>\n<h4>\u0422\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u0442\u0435\u043a<\/h4>\n<ul>\n<li>\n<p>.NET Core 3.1<\/p>\n<\/li>\n<li>\n<p>MS SQL Server 2016<\/p>\n<\/li>\n<li>\n<p>Entity Framework Core 5<\/p>\n<ul>\n<li>\n<p>\u0412\u0441\u0435 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437\u00a0<a href=\"https:\/\/learn.microsoft.com\/en-us\/ef\/core\/modeling\/entity-properties?tabs=data-annotations%2Cwithout-nrt\" rel=\"noopener noreferrer nofollow\">Data Annotations<\/a>.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>ASP .NET Core 3.1<\/p>\n<\/li>\n<li>\n<p>Autofac \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 DI-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430<\/p>\n<\/li>\n<\/ul>\n<h3>\u0420\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/h3>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430, \u0438\u0437 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u0411\u0414 \u0431\u044b\u043b\u043e \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043b\u043e\u0451\u0432:<\/p>\n<ul>\n<li>\n<p>C\u0443\u0449\u043d\u043e\u0441\u0442\u0438 EF \u0432 \u0432\u0438\u0434\u0435 POCO-\u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u0431\u0435\u0437 \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u0441\u0441\u044b\u043b\u043e\u043a \u043d\u0430 EF \u0438 \u0431\u0435\u0437 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0439\/\u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0438\u0445 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f, \u043a\u043b\u044e\u0447\u0438 \u0438 \u0441\u0432\u044f\u0437\u0438 \u043c\u0435\u0436\u0434\u0443 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044f\u043c\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b<\/p>\n<ul>\n<li>\n<p>\u0414\u043b\u044f \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 EF.<\/p>\n<\/li>\n<li>\n<p>\u0414\u043b\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 EF.<\/p>\n<\/li>\n<li>\n<p>\u0414\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f\/\u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0411\u0414, UnitOfWork\u00a0&#8212; \u0447\u0430\u0441\u0442\u044c \u0443\u043d\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u043a \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 Data Access Layer<\/p>\n<details class=\"spoiler\">\n<summary>\u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b \u0447\u0442\u0435\u043d\u0438\u044f\/\u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0411\u0414. \u0424\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Fortis.Common.DAL<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cs\">\/\/ Copyright \u00a9 2022 \u041e\u041e\u041e \"\u0424\u043e\u0440\u0442\u0438\u0441\", \u0413\u041a \"\u041c\u043e\u043d\u043e\u043f\u043e\u043b\u0438\u044f\" namespace Fortis.Common.DataAccessLayer.Contracts;  \/\/\/ &lt;summary> \/\/\/ \u041f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0438\u0437 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 \/\/\/ \u0410\u0431\u0441\u0442\u0440\u0430\u0433\u0438\u0440\u043e\u0432\u0430\u043d \u043e\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0421\u0423\u0411\u0414 \u0438 ORM \/\/\/ &lt;\/summary> public interface IDbReader { \/\/\/ &lt;summary> \/\/\/ \u041f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0438\u0437 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 \/\/\/ &lt;\/summary> IQueryable&lt;TEntity> Read&lt;TEntity>() where TEntity : class, IDbEntity; }  \/\/\/ &lt;summary> \/\/\/ \u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0432 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \/\/\/ \u0410\u0431\u0441\u0442\u0440\u0430\u0433\u0438\u0440\u043e\u0432\u0430\u043d \u043e\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0421\u0423\u0411\u0414 \u0438 ORM \/\/\/ &lt;\/summary> public interface IDbWriter { \/\/\/ &lt;summary>\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u0437\u0430\u043f\u0438\u0441\u044c&lt;\/summary> void Add&lt;TEntity>(TEntity entity) where TEntity : class, IDbEntity;  \/\/\/ &lt;summary>\u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u044c&lt;\/summary> void Update&lt;TEntity>(TEntity entity) where TEntity : class, IDbEntity;  \/\/\/ &lt;summary>\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u044c&lt;\/summary> void Delete&lt;TEntity>(TEntity entity) where TEntity : class, IDbEntity; }  \/\/\/ &lt;summary>\u0421\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430&lt;\/summary> public interface IDbUnitOfWork { \/\/\/ &lt;summary>\u0410\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0432\u0441\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u0432 Db&lt;\/summary> \/\/\/ &lt;returns>\u0427\u0438\u0441\u043b\u043e \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438, \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0432 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445&lt;\/returns> Task&lt;int> SaveChangesAsync(CancellationToken cancellationToken);  \/\/\/ &lt;summary>\u0421\u043e\u0437\u0434\u0430\u0435\u0442 \u043d\u043e\u0432\u0443\u044e \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044e&lt;\/summary> IDbTransaction InTransaction(); }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cs\">\/\/ Copyright \u00a9 2022 \u041e\u041e\u041e \"\u0424\u043e\u0440\u0442\u0438\u0441\", \u0413\u041a \"\u041c\u043e\u043d\u043e\u043f\u043e\u043b\u0438\u044f\" using System.Linq;\u2028 using Fortis.Common.DataAccessLayer.Contracts;\u2028 using Fortis.GeographyEF.Abstract;\u2028 using Microsoft.EntityFrameworkCore;  namespace Fortis.GeographyEF;  partial class GeographyDbContext : IMsSqlGeographyDbReader, IMsSqlGeographyDbWriter, IDbUnitOfWork { void IDbWriter.Add&lt;TEntity>(TEntity entity) => Entry(entity).State = EntityState.Added;  void IDbWriter.Update&lt;TEntity>(TEntity entity) => base.Entry(entity).State = EntityState.Modified;  void IDbWriter.Delete&lt;TEntity>(TEntity entity) => base.Entry(entity).State = EntityState.Deleted;  IQueryable&lt;TEntity> IDbReader.Read&lt;TEntity>() => base.Set&lt;TEntity>() .AsNoTracking() .AsQueryable();  Task&lt;int> IDbUnitOfWork.SaveChangesWithoutAuditAsync(CancellationToken cancellationToken) => SaveChangesAsync(cancellationToken);  Task&lt;int> IDbUnitOfWork.SaveChangesAsync(CancellationToken cancellationToken) => SaveChangesWithDetachAsync(cancellationToken);  IDbUnitOfWork.IDbTransaction InTransaction() { var internalTransaction = Database.BeginTransaction(); return new GeographyDbTransaction(internalTransaction); }  \/\/\/ &lt;summary> \/\/\/ \u041c\u0435\u0442\u043e\u0434 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441 Detach \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439 \/\/\/ &lt;\/summary> internal async Task&lt;int> SaveChangesWithDetachAsync(CancellationToken cancellationToken) { var count = await base.SaveChangesAsync(cancellationToken); foreach (var entry in base.ChangeTracker.Entries().ToArray()) { entry.State = EntityState.Detached; }  return count; } }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul>\n<li>\n<p>\u0421\u0430\u043c DbContext \u0434\u043b\u044f MS SQL, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0438\u0439 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0432\u044b\u0448\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0435\u0433\u043e \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0438 Autofac-\u043c\u043e\u0434\u0443\u043b\u044c, \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0432 DI \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u044b\u0439 \u0432 web API \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438.<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u0434\u043b\u044f MS SQL \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435\u00a0<a href=\"https:\/\/learn.microsoft.com\/en-us\/ef\/core\/modeling\/\" rel=\"noopener noreferrer nofollow\">Fluent API Configuration<\/a><\/p>\n<ul>\n<li>\n<p>\u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446 \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 IEntityTypeConfiguration&lt;TEnity>.<\/p>\n<details class=\"spoiler\">\n<summary>\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cs\">\/\/ Copyright \u00a9 2022 \u041e\u041e\u041e \"\u0424\u043e\u0440\u0442\u0438\u0441\", \u0413\u041a \"\u041c\u043e\u043d\u043e\u043f\u043e\u043b\u0438\u044f\" namespace Fortis.GeographyEF.Entities.Configurations.MsSql; public class SettlementConfiguration : IEntityTypeConfiguration&lt;Settlement> {     public void Configure(EntityTypeBuilder&lt;Settlement> builder)     {     builder.ToTable(\"Settlements\");         builder.HasKey(p =&amp;gt; p.Id);         builder.Property(p =&amp;gt; p.Id).ValueGeneratedOnAdd();                   builder.Property(o =&amp;gt; o.Name)             .IsRequired()             .HasMaxLength(100)             .HasColumnType(\"NVARCHAR(100)\");         builder.Property(o =&amp;gt; o.Abbreviation)             .IsRequired()             .HasMaxLength(15)             .HasColumnType(\"NVARCHAR(15)\");              builder.HasOne(p =&amp;gt; p.Region)             .WithMany(p =&amp;gt; p.Settlements)             .HasForeignKey(p =&amp;gt; p.RegionId)             .OnDelete(DeleteBehavior.Cascade);     } }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<\/li>\n<li>\n<p>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0442\u0430\u043a\u043e\u0433\u043e \u0440\u043e\u0434\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0439 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u0411\u0414.<\/p>\n<details class=\"spoiler\">\n<summary>\u041f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0439 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cs\">\/\/ Copyright \u00a9 2022 \u041e\u041e\u041e \"\u0424\u043e\u0440\u0442\u0438\u0441\", \u0413\u041a \"\u041c\u043e\u043d\u043e\u043f\u043e\u043b\u0438\u044f\" namespace Fortis.GeographyEF; internal sealed class GeographyDbContext: DbContext, IGeographyDbContext {     \/\/...     protected override void OnModelCreating(ModelBuilder builder)     {         base.OnModelCreating(builder);              builder.ApplyConfigurationsFromAssembly(typeof(SettlementConfiguration).Assembly);     } }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u0421\u043b\u043e\u0439 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0435\u0432, \u0437\u0430\u0432\u0438\u0441\u044f\u0449\u0438\u0445 \u043d\u0435 \u043e\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430, \u0430 \u043e\u0442 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0438 (\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430).<\/p>\n<\/li>\n<\/ul>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0430\u0441\u044c \u0431\u043e\u043b\u0435\u0435 \u043a\u0440\u0430\u0441\u0438\u0432\u0430\u044f \u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u043c\u0430\u044f \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u043b\u043e\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u043e\u0442\u043a\u0440\u044b\u0432\u0448\u0430\u044f \u043f\u0443\u0442\u044c \u043a \u0430\u0431\u0441\u0442\u0440\u0430\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e \u043e\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 Entity Framework \u043f\u043e\u0434 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0443\u044e \u0421\u0423\u0411\u0414.<\/p>\n<h4>\u0421\u043e\u0441\u0442\u0430\u0432\u043d\u044b\u0435 \u0447\u0430\u0441\u0442\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043f\u043e\u0441\u043b\u0435 \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430<\/h4>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<h4>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c PostgreSQL<\/h4>\n<p>\u041d\u0430 \u0434\u0430\u043d\u043d\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0431\u044b\u043b\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043e \u0435\u0449\u0435 \u0434\u0432\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u0440\u0430\u043d\u0435\u0435 \u0434\u043b\u044f MS SQL:<\/p>\n<ul>\n<li>\n<p>DbContext \u0434\u043b\u044f PostgreSQL, \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0441\u0445\u0435\u043c\u044b \u0438 Autofac-\u043c\u043e\u0434\u0443\u043b\u044c.<\/p>\n<ul>\n<li>\n<p>\u0418\u043d\u0438\u0446\u0438\u0438\u0440\u0443\u044e\u0449\u0443\u044e \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044e \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0442\u0443\u0442 \u0436\u0435.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 PostgreSQL \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 Fluent API Configuration.<\/p>\n<\/li>\n<\/ul>\n<h4>\u0421\u043e\u0441<\/h><\/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-341614","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/341614","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=341614"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/341614\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=341614"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=341614"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=341614"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}