This commit is contained in:
2023-12-16 21:18:01 +02:00
parent 775146ee86
commit 2feaf50802
46 changed files with 641 additions and 429 deletions
@@ -1,27 +1,22 @@
namespace MyOffice.Web.Models.Currency
/// <see cref="MyOffice.Data.Models.Currencies.CurrencyGlobal"/>
/// <see cref="MyOffice.Services.Currency.Domain.CurrencyGlobalDto"/>
namespace MyOffice.Web.Models.Currency;
using AutoMapper;
using MyOffice.Services.Currency.Domain;
public class CurrencyGlobalViewModel
{
using Data.Models.Currencies;
using Microsoft.AspNetCore.Mvc.ModelBinding.Binders;
public class CurrencyGlobalViewModel
{
public string Id { get; set; } = null!;
public string Name { get; set; } = null!;
public int Quantity { get; set; }
public string Symbol { get; set; } = null!;
}
public static class CurrencyGlobalViewModelExtensions
{
public static CurrencyGlobalViewModel ToModel(this CurrencyGlobal input)
{
return new CurrencyGlobalViewModel
{
Id = input.Id,
Name = input.Name,
Quantity = input.DefaultQuantity,
Symbol = input.Symbol,
};
}
}
public string Id { get; set; } = null!;
public string Name { get; set; } = null!;
public int Quantity { get; set; }
public string Symbol { get; set; } = null!;
}
public class CurrencyGlobalViewModelProfile : Profile
{
public CurrencyGlobalViewModelProfile()
{
CreateMap<CurrencyGlobalDto, CurrencyGlobalViewModel>();
}
}