Escali License control 1
PriceElementViewModel.cs
Gå til dokumentasjonen til denne filen.
1using AutoMapper;
5
7{
9 {
11
12 public List<PriceElementClientModel>? PriceElements { get; private set; }
13
15 {
17 _mapper = mapper;
18 }
19
20 public async Task GetPriceElements()
21 {
22 var priceElements = await _priceElementService.GetAllPriceElements();
23 UpdatePriceElements(_mapper.Map<List<PriceElementClientModel>>(priceElements));
24 }
25
26 private void UpdatePriceElements(List<PriceElementClientModel> priceElements)
27 {
28 PriceElements = priceElements;
30 }
31
32 }
33}
var context
Definition: Program.cs:49
void UpdatePriceElements(List< PriceElementClientModel > priceElements)
PriceElementService class inserts and updates PriceElement in the Database
async Task< List< PriceElement > > GetAllPriceElements()
Read all PriceElements from database