mirror of
https://github.com/Microsoft/sql-server-samples.git
synced 2025-12-08 14:58:54 +00:00
Adding the samples content from extending the getting started website for azure specific workflows
22 lines
604 B
C#
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; }
|
|
}
|
|
} |