diff --git a/FakeTrello/FakeTrello.csproj b/FakeTrello/FakeTrello.csproj index ee73a9c..f6feb5e 100644 --- a/FakeTrello/FakeTrello.csproj +++ b/FakeTrello/FakeTrello.csproj @@ -184,8 +184,14 @@ Global.asax + + + + + + diff --git a/FakeTrello/Models/Board.cs b/FakeTrello/Models/Board.cs new file mode 100644 index 0000000..5f02e27 --- /dev/null +++ b/FakeTrello/Models/Board.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Web; + +namespace FakeTrello.Models +{ + public class Board + { + [Key] + public int BoardId { get; set; } + + public string Name { get; set; } + + public string URL { get; set; } + + public List Lists { get; set; } + } +} \ No newline at end of file diff --git a/FakeTrello/Models/Card.cs b/FakeTrello/Models/Card.cs new file mode 100644 index 0000000..2aaad76 --- /dev/null +++ b/FakeTrello/Models/Card.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Web; + +namespace FakeTrello.Models +{ + public class Card + { + [Key] + public int CardId { get; set; } + + public string Title { get; set; } + + public string Description { get; set; } + } +} \ No newline at end of file diff --git a/FakeTrello/Models/CardList.cs b/FakeTrello/Models/CardList.cs new file mode 100644 index 0000000..4274ad3 --- /dev/null +++ b/FakeTrello/Models/CardList.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace FakeTrello.Models +{ + public class CardList + { + public int CardId { get; set; } + + public int ListId { get; set; } + } +} \ No newline at end of file diff --git a/FakeTrello/Models/CardUserAndCreator.cs b/FakeTrello/Models/CardUserAndCreator.cs new file mode 100644 index 0000000..a3f7a4e --- /dev/null +++ b/FakeTrello/Models/CardUserAndCreator.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace FakeTrello.Models +{ + public class CardUserAndCreator + { + public int TrelloUserId { get; set; } + + public int CardCreatorID { get; set; } + } +} \ No newline at end of file diff --git a/FakeTrello/Models/List.cs b/FakeTrello/Models/List.cs new file mode 100644 index 0000000..9e1219a --- /dev/null +++ b/FakeTrello/Models/List.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Web; + +namespace FakeTrello.Models +{ + public class List + { + [Key] + public int ListId { get; set; } + + public string Name { get; set; } + + public List Cards { get; set; } + } +} \ No newline at end of file diff --git a/FakeTrello/Models/TrelloUser.cs b/FakeTrello/Models/TrelloUser.cs new file mode 100644 index 0000000..e0335a9 --- /dev/null +++ b/FakeTrello/Models/TrelloUser.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Web; + +// Entity is our Object Relational Mapper (ORM) + +namespace FakeTrello.Models +{ + public class TrelloUser + { + [Key] + public int TrelloUserId { get; set; } // Primary Key (not nullible; must be unique) + + // Stacking of properties applies multiple annotations + // to the following property + [MinLength(10)] + [MaxLength(60)] + public string Email { get; set; } + + [MaxLength(60)] + public string Username { get; set; } + + [MaxLength(60)] + public string FullName { get; set; } + + [MaxLength(60)] + public string PasswordHash { get; set; } + + public ApplicationUser BaseUser { get; set; } // 1 to 1 relationship + + public List Boards { get; set; } // 1 to many (boards) relationship + } +} \ No newline at end of file diff --git a/FakeTrelloBoardERD.PNG b/FakeTrelloBoardERD.PNG new file mode 100644 index 0000000..e3fb6dd Binary files /dev/null and b/FakeTrelloBoardERD.PNG differ diff --git a/README.md b/README.md index 5128430..91ffb01 100644 --- a/README.md +++ b/README.md @@ -17,4 +17,4 @@ ### Fake Trello ERD -[ERD goes here] +![ERD](FakeTrelloBoardERD.PNG)