Sync101 with Custom Filtering

Shows how to track custom filters and how to use a standard custom provider to send changes from a filter-tracking replica to two different filtered replicas.

C# (58.2 KB)
 
 
 
 
 
(0)
1,322 times
Add to favorites
5/13/2011
E-mail Twitter del.icio.us Digg Facebook
using System;


namespace CustomFilterSyncSample
{
    public class CustomerType : IDataItemOperations<Customer>
    {
        public ushort ChangeUnitCount
        {
            get
            {
                return 4;
            }
        }

        public Customer CreateItem()
        {
            return new Customer();
        }

        public void UpdateItem(Customer item, object value)
        {
            if (item == null || value == null)
                return;

            Customer newCustomerData = (Customer)value;
            
            item.Id = newCustomerData.Id;

            item.PhoneNumber = newCustomerData.PhoneNumber;

            item.State = newCustomerData.State;

            item.Rating = newCustomerData.Rating;                    
        }
    }
}