You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mchsamples-.net-core/AlertSoftwareKit/AlertWebAPI/Models/UserDbContext.cs

34 lines
1.3 KiB

// ========================================================================
//
// Copyright (C) 2017-2018 MARC CHEVALDONNE
// marc.chevaldonne.free.fr
//
// Module : UserDbContext.cs
// Author : Marc Chevaldonné
// Creation date : 2018-02-12
//
// ========================================================================
using Microsoft.EntityFrameworkCore;
namespace AlertWebAPI.Models
{
/// <summary>
/// This classe deriving from DbContext allows CRUD operations on the model.
/// It owns a DbSet<T> allowing CRUD operations on type T, here Users.
///
/// It uses the connection string defined in the OnConfiguring method and pointing to the database I've defined in Azure
/// </summary>
public class UserDbContext : DbContext
{
public DbSet<User> Users { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
base.OnConfiguring(optionsBuilder);
optionsBuilder.UseSqlServer(@"Server=tcp:setsis.database.windows.net,1433;Initial Catalog=AlertsUsersDB;Persist Security Info=False;User ID=setsisUser;Password=setsisPassword1234;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;");
}
}
}