From 57c81cb7ed6b378b079f272710ab7ceff193814a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9E=D0=BB=D1=8F=20=D0=91=D0=B8=D0=B7=D1=8E=D0=BA=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0?= Date: Tue, 17 Dec 2024 11:01:10 +0500 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=B4=D0=B0=D0=BB=D0=B5=D0=BD=D1=8B=20?= =?UTF-8?q?=D1=81=D1=82=D0=B0=D1=80=D1=8B=D0=B5=20=D1=81=D1=81=D1=8B=D0=BB?= =?UTF-8?q?=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Persistence.Client/Persistence.Client.csproj | 62 ------------------- Persistence.Database.Postgres/Readme.md | 11 ---- .../DataSourceSystemRepository.cs | 40 ------------ 3 files changed, 113 deletions(-) delete mode 100644 Persistence.Client/Persistence.Client.csproj delete mode 100644 Persistence.Database.Postgres/Readme.md delete mode 100644 Persistence.Repository/Repositories/DataSourceSystemRepository.cs diff --git a/Persistence.Client/Persistence.Client.csproj b/Persistence.Client/Persistence.Client.csproj deleted file mode 100644 index 7d81fc3..0000000 --- a/Persistence.Client/Persistence.Client.csproj +++ /dev/null @@ -1,62 +0,0 @@ - - - - net8.0 - enable - enable - - - True - - Persistence.Client - - 1.0.$([System.DateTime]::UtcNow.ToString(yyMM.ddHH)) - - 1.0.$([System.DateTime]::UtcNow.ToString(yyMM.ddHH)) - - Persistence.Client - - - Digital Drilling - - Digital Drilling - - Пакет для получения клиентов для работы с Persistence сервисом - - - https://git.ddrilling.ru/on.nemtina/persistence.git - - git - - true - - snupkg - - C:\Projects\Nuget - - - Readme.md - - - - 1.0.$([System.DateTime]::UtcNow.ToString(yyMM.ddHH)) - 1.0.$([System.DateTime]::UtcNow.ToString(yyMM.ddHH)) - - - - - - - - - - - - - - - - - - - diff --git a/Persistence.Database.Postgres/Readme.md b/Persistence.Database.Postgres/Readme.md deleted file mode 100644 index 7172774..0000000 --- a/Persistence.Database.Postgres/Readme.md +++ /dev/null @@ -1,11 +0,0 @@ -## Создать миграцию -``` -dotnet ef migrations add --project Persistence.Database.Postgres - -``` - -## Откатить миграцию -``` -dotnet ef migrations remove --project Persistence.Database.Postgres -``` -Удаляется последняя созданная миграция. \ No newline at end of file diff --git a/Persistence.Repository/Repositories/DataSourceSystemRepository.cs b/Persistence.Repository/Repositories/DataSourceSystemRepository.cs deleted file mode 100644 index 5862ea3..0000000 --- a/Persistence.Repository/Repositories/DataSourceSystemRepository.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Mapster; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Caching.Memory; -using Newtonsoft.Json.Linq; -using Persistence.Database.Entity; -using Persistence.Models; -using Persistence.Repositories; - -namespace Persistence.Repository.Repositories; -public class DataSourceSystemRepository : IDataSourceSystemRepository -{ - protected DbContext db; - public DataSourceSystemRepository(DbContext db) - { - this.db = db; - } - protected virtual IQueryable GetQueryReadOnly() => db.Set(); - - public virtual async Task Add(DataSourceSystemDto dataSourceSystemDto, CancellationToken token) - { - var entity = dataSourceSystemDto.Adapt(); - - await db.Set().AddAsync(entity, token); - await db.SaveChangesAsync(token); - } - - public virtual async Task> Get(CancellationToken token) - { - var query = GetQueryReadOnly(); - var entities = await query.ToArrayAsync(token); - var dtos = entities.Select(e => e.Adapt()); - - return dtos; - } -}