Skip to content
This repository has been archived by the owner on Aug 1, 2023. It is now read-only.

Commit

Permalink
Added initial migration and moved SML to DB.
Browse files Browse the repository at this point in the history
  • Loading branch information
gvcayetano committed Sep 21, 2019
1 parent 9668f39 commit 518a554
Show file tree
Hide file tree
Showing 7 changed files with 766 additions and 56 deletions.
1 change: 1 addition & 0 deletions Gvc.Data/Models/SocialMediaLink.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
public class SocialMediaLink
{
public int Id { get; set; }
public string FontAwesomeClass { get; set; }
public string Url { get; set; }
public string Username { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;

namespace Gvc.Data.Contexts
namespace Gvc.Web.Contexts
{
public class GvcDbContext : IdentityDbContext<ApplicationUser>
{
Expand Down
67 changes: 14 additions & 53 deletions Gvc.Web/Controllers/AboutController.cs
Original file line number Diff line number Diff line change
@@ -1,68 +1,29 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using Gvc.Data.Models;
using Gvc.Web.Contexts;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;

namespace Gvc.Web.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class AboutController : ControllerBase
{
private readonly GvcDbContext _gvcDbContext;

public AboutController(
GvcDbContext gvcDbContext
)
{
_gvcDbContext = gvcDbContext;
}

[HttpGet]
public ActionResult GetSocialMedia()
public async Task<ActionResult<IEnumerable<SocialMediaLink>>> GetSocialMediaLinks()
{
var socialMediaLinks = new List<SocialMediaLink>()
{
new SocialMediaLink()
{
Url = "http://bit.ly/2zhCJ4T",
FontAwesomeClass = "fab fa-facebook",
Username = "@gvcayetano"
},
new SocialMediaLink()
{
Url = "http://bit.ly/2MB63Ml",
FontAwesomeClass = "fab fa-github",
Username = "@gvcayetano"
},
new SocialMediaLink()
{
Url = "http://bit.ly/2PdP9Fz",
FontAwesomeClass = "fab fa-instagram",
Username = "@gvcayetano"
},
new SocialMediaLink()
{
Url = "http://bit.ly/2ZpLBQq",
FontAwesomeClass = "fab fa-linkedin",
Username = "@gvcayetano"
},
new SocialMediaLink()
{
Url = "http://bit.ly/2HikHUr",
FontAwesomeClass = "fab fa-twitter",
Username = "@gvcayetano"
},
new SocialMediaLink()
{
Url = "https://stackshare.io/gvcayetano/my-stack",
FontAwesomeClass = "fas fa-layer-group",
Username = "@gvcayetano"
},
new SocialMediaLink()
{
Url = "https://hub.docker.com/u/gvcayetano",
FontAwesomeClass = "fab fa-docker",
Username = "@gvcayetano"
},
new SocialMediaLink()
{
Url = "https://www.twitch.tv/iamjayjay",
FontAwesomeClass = "fab fa-twitch",
Username = "@iamjayjay"
}
};
return Ok(socialMediaLinks);
return await _gvcDbContext.SocialMediaLinks.ToListAsync();
}
}
}
255 changes: 255 additions & 0 deletions Gvc.Web/Migrations/20190921020014_InitialCreate.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 518a554

Please sign in to comment.