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

FakeBlog - Stephen Szpak #9

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
2 changes: 2 additions & 0 deletions FakeBlog/FakeBlog.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,10 @@
<DependentUpon>Global.asax</DependentUpon>
</Compile>
<Compile Include="Models\AccountViewModels.cs" />
<Compile Include="Models\Author.cs" />
<Compile Include="Models\IdentityModels.cs" />
<Compile Include="Models\ManageViewModels.cs" />
<Compile Include="Models\PublishedWork.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Startup.cs" />
</ItemGroup>
Expand Down
25 changes: 25 additions & 0 deletions FakeBlog/Models/Author.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace FakeBlog.Models
{
public class Author
{
[Key]
public int AuthorId { get; set; }
public string FullName { get; set; }
public string Email { get; set; }
public string Username { get; set; }
public string PasswordHash { get; set; }


public ApplicationUser AuthorName { get; set; }

public ICollection<PublishedWork> Posts { get; set; }


}
}
22 changes: 22 additions & 0 deletions FakeBlog/Models/PublishedWork.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace FakeBlog.Models
{
public class PublishedWork
{
[Key]
public int PublishedWorkId { get; set; }

[Required] //means data cannot be NULL
[MinLength(3)]
public string Name { get; set; }

public string Description { get; set; }
public DateTime DateCreated { get; set; } // Required by default
public DateTime PublishedAt { get; set; }
public bool IsDraft { get; set; }
public bool IsEdited { get; set; }
}
}
26 changes: 26 additions & 0 deletions FakeBlog/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Fake Blog

This exercise will help the students understand the underpinnings of Database design in the context of a MVC application. We will be implementing a Fake Blog together.

## Features

- Users who signup are considered "Authors"
- Published posts will be viewable by everyone
- Authors will be able to make drafts for blog posts
- Authors will be able to manually publish a draft.
- Authors will be able to delete published posts and drafts
- Authors will be able to edit a drafts


## Part 1 Instructions

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

### Fake Blog ERD

[fake blog erd updated.pdf](https://github.com/stephenszpak/FakeBlog/files/818871/fake.blog.erd.updated.pdf)


## Part 2 - Implement the rest of the features