Demo entry 6776922

hola

   

Submitted by alain on Dec 06, 2018 at 04:11
Language: C#. Code size: 735 Bytes.

using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace MyGarage.Data.Abstraction.Models
{
  public class Car
  {
      [Key]
      public int ID {get; set;}
      public  Brand Brand { get; set;}
      [Required]
      public int CreationYear {get; set;}
      [Required]
      [Range(1, 7)]
      public int NbSeats {get; set;}
      public int Power {get; set;}
      public int Price {get; set;}
  }

  public class Brand
  {
      public int Id { get; set; }
      public string name { get; set; }
   public  Model Model { get; set; }

  }

  public class Model
  {
      public int Id { get; set; }
      public string name;
  }
}

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).