Agliullov D. A. Lab Work 3 Hard #7
@ -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,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user