-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
42 additions
and
4 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,44 @@ | ||
using System.ComponentModel.DataAnnotations; | ||
|
||
namespace tour_of_heroes_api.Models | ||
{ | ||
/// <summary> | ||
/// Represents a hero in the Tour of Heroes application. | ||
/// </summary> | ||
public class Hero | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="Hero"/> class with the specified name and alter ego. | ||
/// </summary> | ||
/// <param name="Name">The name of the hero.</param> | ||
/// <param name="AlterEgo">The alter ego of the hero.</param> | ||
public Hero(string Name, string AlterEgo) | ||
{ | ||
this.Name = Name; | ||
this.AlterEgo = AlterEgo; | ||
} | ||
|
||
/// <summary> | ||
/// Gets or sets the ID of the hero. | ||
/// </summary> | ||
[Key] | ||
public int Id { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the name of the hero. | ||
/// </summary> | ||
[Required] | ||
public string Name { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the alter ego of the hero. | ||
/// </summary> | ||
[Required] | ||
public string AlterEgo { get; set; } | ||
public string Description { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the description of the hero. | ||
/// </summary> | ||
public string? Description { get; set; } | ||
} | ||
} |
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
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