using System;
using System.Collections.Generic;
using System.Linq;
using IdeaBlade.Core;

namespace MvvmLightDemo
{
    public partial class Customer
    {
        [AfterSet(EntityPropertyNames.CompanyName)]
        public void UppercaseCompanyNameAfterSet(PropertyInterceptorArgs<Customer, String> args)
        {
            var companyName = args.Value;

            if (!String.IsNullOrEmpty(companyName))
            {
                args.Value = args.Value.ToUpper();
            }
        }

        [AfterGet(EntityPropertyNames.CompanyName)]
        public void UppercaseCompanyNameAfterGet(PropertyInterceptorArgs<Customer, String> args)
        {
            var companyName = args.Value;

            if (!String.IsNullOrEmpty(companyName))
            {
                args.Value = args.Value.ToUpper();
            }
        }
    }
}