コード例 #1
0
        public async Task <ActionResult> Save(Guid id, Guid declaracionID)
        {
            if (id == null)
            {
                return(View(new DepositoModel()));
            }

            var deposito = await _getDepositosUserCase.Execute(id);

            if (deposito == null)
            {
                return(View(new DepositoModel
                {
                    ID = Guid.Empty,
                    DeclaracionID = declaracionID,
                    TipoDeCuenta = String.Empty,
                    TiposDeCuenta = DepositoModel.GetTipoDeCuenta(),
                    Saldo = 0
                }
                            ));
            }

            var modelView = Mapper.Map <DepositoOutput, DepositoModel>(deposito);

            return(PartialView(modelView));
        }
コード例 #2
0
 public static void Configure()
 {
     Mapper.Initialize(x =>
     {
         x.CreateMap <DepositoOutput, DepositoModel>()
         .ForMember(destination => destination.TiposDeCuenta, source => source.MapFrom(list => DepositoModel.GetTipoDeCuenta()));
         x.CreateMap <InmuebleOutput, InmuebleModel>()
         .ForMember(destination => destination.TiposDeInmuebles, source => source.MapFrom(list => InmuebleModel.GetTiposDeInmuebles()));
         x.CreateMap <DeudaBancariaOutput, DeudaBancariaModel>()
         .ForMember(destination => destination.TiposDeDeuda, source => source.MapFrom(list => DeudaBancariaModel.GetTiposDeuda()));
     });
 }