Exemple #1
0
        public static ModelToTableMapper <Customer> CustomerMapper()
        {
            var mapper = new ModelToTableMapper <Customer>();

            mapper.AddMapping(c => c.Id, "Id");
            mapper.AddMapping(c => c.FirstName, "FirstName");

            return(mapper);
        }
        public void WatchTable()
        {
            var mapper = new ModelToTableMapper <Stock>();

            mapper.AddMapping(model => model.Symbol, "Code");
            _dependency            = new SqlTableDependency <Stock>(_connectionString, "Code", mapper);
            _dependency.OnChanged += _dependency_OnChanged;
            _dependency.OnError   += _dependency_OnError;
        }