< Summary

Information
Class: Services.DataServices.ProductsDataServices
Assembly: Services
File(s): /home/runner/work/Studio2Prod/Studio2Prod/AppRepository/DataServices/ProductsDataServices.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 19
Coverable lines: 19
Total lines: 55
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%210%
AddProduct()100%210%
DeleteProduct()100%210%
GetProducts()100%210%
GetProductAsync()100%210%
GetProductAsync()100%210%
Update()100%210%
SaveChanges()100%210%
GetImageUrlsByArticlesAsync()100%210%

File(s)

/home/runner/work/Studio2Prod/Studio2Prod/AppRepository/DataServices/ProductsDataServices.cs

#LineLine coverage
 1using OzonDomains.Models;
 2using OzonRepositories.Data;
 3
 4namespace Services.DataServices
 5{
 6    public class ProductsDataServices : IDataServices
 7    {
 8        private readonly ProductRepository _repository;
 9
 010        public ProductsDataServices(ProductRepository repository)
 11        {
 012            _repository = repository;
 013        }
 14
 15        public async Task<int> AddProduct(Product value)
 16        {
 017            return await _repository.Add(value);
 018        }
 19
 20        public async Task<int> DeleteProduct(Product value)
 21        {
 022            return await _repository.Delete(value);
 023        }
 24
 25        public async Task<List<Product>> GetProducts()
 26        {
 027            return await _repository.Get();
 028        }
 29
 30        public async Task<Product?> GetProductAsync(int id)
 31        {
 032            return await _repository.GetAsync(id);
 033        }
 34
 35        public async Task<Product?> GetProductAsync(Product value)
 36        {
 037            return await _repository.GetAsync(value);
 038        }
 39
 40        public async Task<int> Update(Product value)
 41        {
 042            return await _repository.Update(value);
 043        }
 44        public async Task<int> SaveChanges()
 45        {
 046            return await _repository.SaveChanges();
 047        }
 48
 49        /// <summary>Словарь article → ImageUrl для набора артикулов (offer_id).</summary>
 50        public async Task<Dictionary<string, string>> GetImageUrlsByArticlesAsync(IEnumerable<string> articles)
 51        {
 052            return await _repository.GetImageUrlsByArticlesAsync(articles);
 053        }
 54    }
 55}