order
This commit is contained in:
28
Back/Services/ServPricing.cs
Normal file
28
Back/Services/ServPricing.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using Back.Data.Contracts;
|
||||
using Back.Data.Models;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Shared.DTOs;
|
||||
|
||||
namespace Back.Services
|
||||
{
|
||||
|
||||
public class ServPricing
|
||||
{
|
||||
private readonly IAsyncRepository<Pricing> _repoPricing;
|
||||
|
||||
public ServPricing(IAsyncRepository<Pricing> repoPricing)
|
||||
{
|
||||
_repoPricing = repoPricing;
|
||||
}
|
||||
public async Task<List<PricingDto>> GetPricing()
|
||||
{
|
||||
return await _repoPricing.GetAll()
|
||||
.Select(s=>new PricingDto
|
||||
{
|
||||
PermissionID = s.PermissionID,
|
||||
PermissionTitle=s.Permission.Title,
|
||||
Price = s.Price,
|
||||
}).ToListAsync();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user