Add .NET Core 2.1 versions

This commit is contained in:
Elton Stoneman
2018-09-21 19:23:31 +01:00
parent e3eb2dbd2a
commit 879e5bc477
86 changed files with 28610 additions and 1 deletions

View File

@ -0,0 +1,16 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Worker.Entities
{
[Table("votes")]
public class Vote
{
[Column("id")]
[Key]
public string VoterId { get; set; }
[Column("vote")]
public string VoteOption { get; set; }
}
}

View File

@ -0,0 +1,19 @@
using Microsoft.EntityFrameworkCore;
namespace Worker.Entities
{
public class VoteContext : DbContext
{
private static bool _EnsureCreated;
public VoteContext(DbContextOptions options) : base(options)
{
if (!_EnsureCreated)
{
Database.EnsureCreated();
_EnsureCreated = true;
}
}
public DbSet<Vote> Votes { get; set; }
}
}