예제 #1
0
        static void Main(string[] args)
        {
            var produto = new Produto
            {
                Id = 1,
                Nome = "martelo"
            };

            var produtoPerecivel = new Perecivel
            {
                Id = 2,
                Nome = "maçã",
                Vencimento = DateTime.Now.AddDays(2)
            };

            Console.WriteLine(produto);
            Console.WriteLine(produtoPerecivel);

            Console.ReadKey();
        }
예제 #2
0
 /// <summary>
 /// Create a new Perecivel object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="nome">Initial value of the Nome property.</param>
 /// <param name="vencimento">Initial value of the Vencimento property.</param>
 public static Perecivel CreatePerecivel(global::System.Int32 id, global::System.String nome, global::System.DateTime vencimento)
 {
     Perecivel perecivel = new Perecivel();
     perecivel.Id = id;
     perecivel.Nome = nome;
     perecivel.Vencimento = vencimento;
     return perecivel;
 }