namespace Con
{
public class Str
{
//server
public const string ServerCoStr = "";
//Client
public const string ClientCoStr = @"Server=iranMSSQLSEREVER14;Database=Ir;Trusted_C oection=True;MultipleActiveResultSets=true";
}
}
using System;
using System.Collections.Generic;
using System.Text;
using Con;
using DAL.Entitis;
using Microsoft.EntityFrameworkCore;
namespace DAL
{
public class DataContext : DbContext
{
public DataContext()
{
}
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseSqlServer(Con.ClientCoStr);
}
protected override void OnModelCreating(ModelBuilder builder)
{
base.OnModelCreating(builder);
}
public DbSet<TblTopics> TblTopics { get; set; }
}
}
برچسب:
نویسنده: خنج