Ramco Ramco

Ramco Ramco

  • 1.5k
  • 555
  • 20.1k

Multiple Classes in 1 Class

Jul 5 2021 10:34 AM

Hi

   I created 1 class Invoice . I added another class Invoice Details . Is this O.k

 

Secondly what is the difference between Public class & public partial class

 public class Invoice
    {
        public Invoice()
        {
        }

        [Key]
        public string No { get; set; }

        [DataType(DataType.Date)]
        [DisplayFormat(DataFormatString = "{0:dd/MM/yyyy}", ApplyFormatInEditMode = true)]
        public string DocDate { get; set; }

        public virtual ICollection<InvoiceDetail> InvoiceDetails { get; set; }
        public string Status { get; set; }

    }

    public partial class InvoiceDetail
    {
        public string DocNo { get; set; }
        public Product Id { get; set; }
        public decimal Quantity { get; set; }
        public Nullable<decimal> price { get; set; }
        public Nullable<decimal> GrossAmount { get; set; }
        public Nullable<decimal> NetAmount { get; set; }
    }

Thanks


Answers (1)