Agliullov D. A. Lab Work 3 Hard #7

Closed
d.agliullov wants to merge 15 commits from Lab3_Hard into Lab2_Hard
Showing only changes of commit b18e9a142d - Show all commits

View File

@ -69,15 +69,23 @@ namespace ConfectioneryDatabaseImplement.Models
DateImplement = model.DateImplement;
Id = model.Id;
}
public OrderViewModel GetViewModel => new()
{
PastryId = PastryId,
Count = Count,
Sum = Sum,
Status = Status,
DateCreate = DateCreate,
DateImplement = DateImplement,
Id = Id,
};
public OrderViewModel GetViewModel
{
get
{
var context = new ConfectioneryDatabase();
return new()
{
PastryName = context.Pastries.FirstOrDefault(x => x.Id == PastryId)?.PastryName ?? string.Empty,
PastryId = PastryId,
Count = Count,
Sum = Sum,
Status = Status,
DateCreate = DateCreate,
DateImplement = DateImplement,
Id = Id,
};
}
}
}
}