
Security News
Open Source Maintainers Feeling the Weight of the EU’s Cyber Resilience Act
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.
Release 2.0.1.0 for SqlTableDependency June 2015 Copyright (c) Christian Del Bianco 2015
This document provides information about SqlTableDependency.
TABLE OF CONTENTS *Fixed Bugs Since Last 2.0.0.0 NuGet Release
TABLE OF CONTENTS
CREATE TABLE [dbo].[Customer] ( [Identifier] [int] IDENTITY(1,1) NOT NULL, [First Name] nvarchar NOT NULL, [Second Name] nvarchar NOT NULL)
And this model:
public class Customer
{
public int Id { get; set; }
public string Name { get; set; }
public string Surname { get; set; }
// Column not present in Customer database table, so it will not be left empty
public string City { get; set; }
}
It is possible to map in the following way:
string ConnectionString = "data source=.;initial catalog=TableDependencyDB;integrated security=True";
var mapper = new ModelToTableMapper<Customer>();
mapper.AddMapping(c => c.Name, "First Name").AddMapping(c => c.Surname, "Second Name");
var tableDependency = new SqlTableDependency<Customer>(
ConnectionString,
"customer",
modelToColumnsTableMapper: mapper);
2. Columns to monitor for SQL update It is possible to specify a list of table columns that, when modified, will trigger an event C# side. Doing that, you can filter the notification received for changed in table:
string ConnectionString = "data source=.;initial catalog=TableDependencyDB;integrated security=True";
string TableName = "Customer";
var tableDependency = new SqlTableDependency<Customer>(
ConnectionString,
TableName,
columnsToMonitorDuringUpdate: new List<string>() { "second name" }))
tableDependency.OnChanged += TableDependency_Changed;
tableDependency.Start();
Now you will receive notification about UPDATE operation performed on table Customer only when the [Second Name] colomn has been modified.
OnError event Every error raise during the listening stage, it is notified to client with that event:
static void Main() { var mapper = new ModelToTableMapper(); mapper.AddMapping(c => c.Name, "First Name").AddMapping(c => c.Surname, "Second Name");
using (var tableDependency = new SqlTableDependency<Customer>(ConnectionString, TableName)
{
tableDependency.OnChanged += TableDependency_Changed;
tableDependency.OnError += TableDependency_OnError;
tableDependency.Start();
Console.WriteLine("Waiting for receiving notifications: change some records in the table...");
Console.WriteLine("Press a key to exit");
Console.ReadKey();
tableDependency.Stop();
}
}
static void TableDependency_OnError(object sender, ErrorEventArgs e)
{
Exception ex = e.Error;
}
This section list bugs that have been fixed since the last NuGet release.
BUG https://sqltabledependency.codeplex.com/workitem/1 Fixed with the case insensitive matching between model property name and database table column name.
Documentation available at https://sqltabledependency.codeplex.com/
FAQs
Unknown package
We found that tabledependency demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.