Permalink
Cannot retrieve contributors at this time
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
executable file
30 lines (24 sloc)
830 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using SimpleSQL; | |
| public class StarShip | |
| { | |
| // StarShipID is the primary key, which automatically gets the NotNull attribute | |
| [PrimaryKey] | |
| public int StarShipID { get; set; } | |
| // The starship name will have an index created in the database. | |
| // It's max length is set to 60 characters. | |
| // The name cannot be null. | |
| [Indexed, MaxLength(60), NotNull] | |
| public string StarShipName { get; set; } | |
| // The home planet name's maximum length is set to 100 characters. | |
| // The default value is set to Earth | |
| [MaxLength(100), Default("Earth")] | |
| public string HomePlanet { get; set; } | |
| // The range cannot be null. | |
| [NotNull] | |
| public float Range { get; set; } | |
| // The armor's default value is set to 120 | |
| [Default(120.0f)] | |
| public float Armor { get; set; } | |
| // Firepower has no restrictions | |
| public float Firepower { get; set; } | |
| } |