示例#1
0
 public int ExecuteSqlCommand(string sql, params SqlParameter[] parameters)
 {
     _dbContext.SaveChanges();
     return(_dbContext
            .Database
            .ExecuteSqlCommand(sql, parameters));
 }
示例#2
0
 public void Intercept(IInvocation invocation)
 {
     using (var context = new BlDbContext("Server=tcp:taturevichserver.database.windows.net,1433;" +
                                          "Initial Catalog=NewDb;Persist Security Info=False;" +
                                          "User ID=ivan_taturevich;Password=Aa83386491994;" +
                                          "MultipleActiveResultSets=False;Encrypt=True;" +
                                          "TrustServerCertificate=False;Connection Timeout=30;"))
     {
         invocation.Proceed();
         context.SaveChanges();
     }
 }
示例#3
0
 public void Add(TEntity entity)
 {
     BaseRepository.Add(entity);
     _dataContext.SaveChanges();
 }