public int ExecuteSqlCommand(string sql, params SqlParameter[] parameters) { _dbContext.SaveChanges(); return(_dbContext .Database .ExecuteSqlCommand(sql, parameters)); }
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(); } }
public void Add(TEntity entity) { BaseRepository.Add(entity); _dataContext.SaveChanges(); }