Added Genre and Year models, Genre and Year Context, Genre and Year Stores, Genre and Year skeleton APIControllers #41 and #42

This commit is contained in:
amazing-username
2019-05-13 21:19:15 -04:00
parent d75d2924a7
commit cd2da929eb
10 changed files with 276 additions and 2 deletions
-2
View File
@@ -3,7 +3,6 @@ using System.Collections.Generic;
using System.Globalization;
using MySql.Data.MySqlClient;
//using NLog;
using Icarus.Models;
@@ -12,7 +11,6 @@ namespace Icarus.Models.Context
public class AlbumStoreContext : BaseStoreContext
{
#region Fields
//private static Logger _logger = NLog.LogManager.GetCurrentClassLogger();
#endregion
+27
View File
@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore;
using MySql.Data;
using MySql.Data.EntityFrameworkCore.Extensions;
using MySql.Data.MySqlClient;
using Icarus.Models;
namespace Icarus.Models.Context
{
public class GenreContext : DbContext
{
public DbSet<Genre> Genres { get; set; }
public GenreContext(DbContextOptions<GenreContext> options)
: base(options)
{ }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<Genre>()
.ToTable("Genre");
}
}
}
+33
View File
@@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using MySql.Data.MySqlClient;
using Icarus.Models;
namespace Icarus.Models.Context
{
// TODO: Implement Genre store #41
public class GenreStoreContext : BaseStoreContext
{
#region Fields
#endregion
#region Properties
#endregion
#region Constructors
public GenreStoreContext(string connectionString)
{
_connectionString = connectionString;
}
#endregion
#region Methods
#endregion
}
}
+27
View File
@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore;
using MySql.Data;
using MySql.Data.EntityFrameworkCore.Extensions;
using MySql.Data.MySqlClient;
using Icarus.Models;
namespace Icarus.Models.Context
{
public class YearContext : DbContext
{
public DbSet<Year> YearValues { get; set; }
public YearContext(DbContextOptions<YearContext> options)
: base(options)
{ }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<Year>()
.ToTable("Year");
}
}
}
+33
View File
@@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using MySql.Data.MySqlClient;
using Icarus.Models;
namespace Icarus.Models.Context
{
// TODO: Implement Year store #42
public class YearStoreContext : BaseStoreContext
{
#region Fields
#endregion
#region Properties
#endregion
#region Constructors
public YearStoreContext(string connectionString)
{
_connectionString = connectionString;
}
#endregion
#region Methods
#endregion
}
}