You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i have a column in database: "COM_TIME" and in model : "ComTime"
then use Custom Mapper
var mapper = new ModelToTableMapper<MyEvent>();
mapper.AddMapping(c => c.ComTime, "COM_TIME");
//Using SqlTableDependencyFilter
var dt = DateTime.Now;
Expression<Func<MyEvent, bool>> expression = p => p.ComTime == dt;
ITableDependencyFilter whereCondition = new SqlTableDependencyFilter<MyEvent>(expression);
it don't work ...
and i found error in sql profiler
CREATE TRIGGER [tr_dbo_SHIJIAN_e1647094-2b4a-44e6-9630-2ce4177d3f3d] ON [dbo].[SHIJIAN] AFTER update AS
..........
a WHERE ([ComTime] = '2018-04-24T03:55:47')
//there is ComTime and not COM_TIME ....
The text was updated successfully, but these errors were encountered:
// Because our model has a property that does not match table column name, we need a mapper C# Model PROPERTY <--> Database Table Column Name
var mapper = new ModelToTableMapper<Product>();
mapper.AddMapping(c => c.ItemsInStock, "Quantity");
mapper.AddMapping(c => c.ComTime, "COM_TIME");
// Define WHERE filter specifing the WHERE condition
// We also pass the mapper defined above as last contructor's parameter
var ti = DateTime.Now;
Expression<Func<Product, bool>> expression = p => (p.ComTime > ti);
ITableDependencyFilter whereCondition = new SqlTableDependencyFilter<Product>(expression, mapper);
// Create SqlTableDependency and pass filter condition, as weel as mapper
using (var dep = new SqlTableDependency<Product>(connectionString, "Products", mapper: mapper, filter: whereCondition))
{
dep.OnChanged += Changed;
dep.OnError += OnError;
dep.Start();
Console.WriteLine(@"TableDependency, SqlTableDependency, SqlTableDependencyFilter");
Console.WriteLine(@"Copyright (c) 2015-2017 Christian Del Bianco.");
Console.WriteLine(@"All rights reserved." + Environment.NewLine);
Console.WriteLine();
Console.WriteLine(@"Waiting for receiving notifications...");
Console.WriteLine(@"Press a key to stop");
Console.ReadKey();
}
i have a column in database: "COM_TIME" and in model : "ComTime"
then use Custom Mapper
it don't work ...
and i found error in sql profiler
The text was updated successfully, but these errors were encountered: