37 lines
1018 B
C#
Raw Normal View History

using ServiceStationDataModels.Enums;
using ServiceStationDataModels.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using Newtonsoft.Json;
namespace ServiceStationContracts.ViewModels
{
public class DefectViewModel : IDefectModel
{
public int Id { get; set; }
[DisplayName("Тип неисправности")]
public string DefectType { get; set; } = string.Empty;
2024-04-17 16:38:34 +04:00
[DisplayName("Цена неисправности")]
public double DefectPrice { get; set; }
public int ExecutorId { get; set; }
2024-04-29 22:25:39 +04:00
public int? RepairId { get; set; }
public Dictionary<int, ICarModel> DefectCars { get; set; } = new();
public DefectViewModel() { }
[JsonConstructor]
public DefectViewModel(Dictionary<int, CarViewModel> DefectCars)
{
this.DefectCars = DefectCars.ToDictionary(x => x.Key, x => x.Value as ICarModel);
}
}
}