Files
sql-server-samples/samples/tutorials/AzureSqlGettingStartedSamples/csharp/Unix-based/AzureSqlEFSample/EFSampleContext.cs
T

22 lines
604 B
C#

using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.SqlServer;
namespace AzureSqlEFSample
{
public class EFSampleContext : DbContext
{
string _connectionString;
public EFSampleContext(string connectionString)
{
this._connectionString = connectionString;
}
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseSqlServer(this._connectionString);
}
public DbSet<User> Users { get; set; }
public DbSet<Task> Tasks { get; set; }
}
}