4
namespace WMB.CieloB
{
internal class FuncoesCielo
{
internal FuncoesCielo(int iDC, Boleto boleto)
{
IDCliente = iDC;
this.boleto = boleto;
}
public int IDCliente { get; set; }
internal Transaction PagamentoComToken()
{
var holder = cielo.holder(IDCliente);
Order orderDadosDoboleto = cielo.order(boleto.BoletoId.ToString(), boleto.Valor );
}
}
}
I’m calling this class through:
namespace WMB.CieloB
{
public class Cobrancas
{
public bool ExecutarRecorrenciaCompleto()
{
IDC = 3;
var boleto = db.boleto.Find(1);//apenas exemplo
var NewPagamento = new FuncoesCielo(IDC, boleto);
var transacao = NewPagamento.PagamentoComToken();
}
}}
That is both the property Idclient and boleto will be available within the class, but one is property (Idclient), another is a field (Boleto) I normally declare a field equal to a variable in this case nor declare.
What is the difference between using the IDCliente
as a method of this.boleto
that has not even been declared (Boleto boleto;
) but I can access it within the class.
Well, you don’t have the property or the field
boleto
, I guess it was just a slip, right?MyVar
also came out of nowhere. I’m not sure what you’re asking. Want to know why you have to create a property? You want to know if you could use a public field and not have the property? Want to know the difference between putting the value in the field by the constructor or by the property?– Maniero
It was not a slip, even not creating yet I can access it! Only the difference between a property and a field that is not declared.
– Dorathoto
Perhaps it is the case to put the whole class to give more context. At least put as the field
boleto
is declared.– Maniero
I think the question has now become clearer, if I put my specific class I believe that will only serve for me, I modified the question so that I can help someone else.
– Dorathoto
This is weird. I think without the context, you can’t see what’s wrong. It’s very strange not having a field
boleto
and strange working. In strange situations, without context it is difficult to know what is happening. I want to try to reproduce the problem here, but only with that I can not.– Maniero
I answered what gave, but after the issues I’m thinking of voting to close as not clear. Each time makes less sense.
– Maniero