Skip to content
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

Mar 06 #21

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions FakeTrello/DAL/FakeTrelloContext.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using FakeTrello.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace FakeTrello.DAL
{
public class FakeTrelloContext : ApplicationDbContext
{
}
}
6 changes: 6 additions & 0 deletions FakeTrello/FakeTrello.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,17 @@
<Compile Include="Controllers\AccountController.cs" />
<Compile Include="Controllers\HomeController.cs" />
<Compile Include="Controllers\ManageController.cs" />
<Compile Include="DAL\FakeTrelloContext.cs" />
<Compile Include="Global.asax.cs">
<DependentUpon>Global.asax</DependentUpon>
</Compile>
<Compile Include="Models\AccountViewModels.cs" />
<Compile Include="Models\Board.cs" />
<Compile Include="Models\Card.cs" />
<Compile Include="Models\IdentityModels.cs" />
<Compile Include="Models\List.cs" />
<Compile Include="Models\ManageViewModels.cs" />
<Compile Include="Models\TrelloUser.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Startup.cs" />
</ItemGroup>
Expand All @@ -198,6 +203,7 @@
<Content Include="Content\Site.css" />
<Content Include="Scripts\bootstrap.js" />
<Content Include="Scripts\bootstrap.min.js" />
<Content Include="README.md" />
<None Include="Scripts\jquery-1.10.2.intellisense.js" />
<Content Include="Scripts\jquery-1.10.2.js" />
<Content Include="Scripts\jquery-1.10.2.min.js" />
Expand Down
23 changes: 23 additions & 0 deletions FakeTrello/Models/Board.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
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; }

//Auxillary (not required to define/drive relationship)
public TrelloUser Owner { get; set; }

public List<List> Lists { get; set; }
}
}
21 changes: 21 additions & 0 deletions FakeTrello/Models/Card.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
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; }

// returns the list the card belongs to
public List BelongsTo { get; set; }
}
}
18 changes: 18 additions & 0 deletions FakeTrello/Models/List.cs
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 ListdId { get; set; }

public string Name { get; set; }

public List<Card> Cards { get; set; }
}
}
36 changes: 36 additions & 0 deletions FakeTrello/Models/TrelloUser.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
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

// Stacking of properties applies to 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; }

public ApplicationUser BaseUser { get; set; } // 1 to 1 relationship

public List<Board> Boards { get; set; } // 1 to many (boards) relationship

public List<List> Lists { get; set; } // 1 to many

public List<Card> Cards { get; set; } // 1 to many
}
}
20 changes: 20 additions & 0 deletions FakeTrello/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Fake Trello

## Features

- Users will be able to create boards, lists and cards.
- Users will be able to delete baords, lists and cards.
- Users will be able to attach up to 3 other users to a cards (regardless of card creator).
- Users will be able to move and copy Cards between lists


## Instructions

1. Create a Logical ERD (models with columns).
2. Add your ERD to this README as an image. (under the "Fake Trello ERD" section)
2. Create C#/Entity models using your ERD


### Fake Trello ERD

![My ERD](/FakeTrello.jpg?raw=true)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't displaying for me.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, mmmm I added the image to mine by editing the README on Github....I may need to import the image into my project folder. I can refactor my code to match my ERD.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@katerebekah I think mine more accurately reflects my own ERD now. Removed references to classes not in my model.