-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trello exercise #4
Open
alexsaber89
wants to merge
2
commits into
nss-evening-cohort-04:master
Choose a base branch
from
alexsaber89:feb_28
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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 |
---|---|---|
@@ -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<List> Lists { 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; } | ||
} | ||
} |
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 |
---|---|---|
@@ -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; } | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Web; | ||
|
||
namespace FakeTrello.Models | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just like my note above, you don't need to create this class for the join table. Entity Framework will create the table based on the navigation property in your Trello User class. |
||
{ | ||
public class CardUserAndCreator | ||
{ | ||
public int TrelloUserId { get; set; } | ||
|
||
public int CardCreatorID { 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<Card> Cards { 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<Board> Boards { get; set; } // 1 to many (boards) relationship | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
|
@@ -17,4 +17,4 @@ | |
|
||
### Fake Trello ERD | ||
|
||
[ERD goes here] | ||
 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the intention for this class is to represent the one-to-many relationship between Lists and Cards, you don't need to make a class to represent a join table in SQL. Entity Framework will create the join table without this class with just the List in your List class.