Case_accounting/CaseAccounting/CaseAccountingContracts/BindingModels/LawyerBindingModel.cs

48 lines
1.4 KiB
C#
Raw Normal View History

using CaseAccountingContracts.ViewModels;
using CaseAccountingDataModels.Models;
2023-05-19 20:02:17 +04:00
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
namespace CaseAccountingContracts.BindingModels
{
public class LawyerBindingModel : ILawyerModel
{
public string Name { get; set; } = string.Empty;
public string Surname { get; set; } = string.Empty;
public string Patronymic { get; set; } = string.Empty;
public int Experience { get; set; }
2023-05-19 20:02:17 +04:00
public int? SpecializationId { get; set; }
2023-04-01 19:39:50 +04:00
public int UserId { get; set; }
public int Id { get; set; }
2023-05-19 21:27:33 +04:00
public Dictionary<int, ICaseModel> Cases { get; set; } = new();
public List<CaseViewModel> CaseViewModels { get; set; } = new();
public Dictionary<int, IContractModel> Contracts { get; set; } = new();
public List<ContractViewModel> ContractViewModels { get; set; } = new();
2023-05-19 20:02:17 +04:00
public LawyerBindingModel() { }
[JsonConstructor]
2023-05-19 21:27:33 +04:00
public LawyerBindingModel(Dictionary<int, ContractViewModel> Contracts, Dictionary<int, CaseViewModel> Cases)
2023-05-19 20:02:17 +04:00
{
this.Contracts = Contracts.ToDictionary(x => x.Key, x => (IContractModel)x.Value);
2023-05-19 21:27:33 +04:00
this.Cases = Cases.ToDictionary(x => x.Key, x => (ICaseModel)x.Value);
2023-05-19 20:02:17 +04:00
}
}
}