>>You code doesn't make sense unless 'value' is a private field - and since you have no setter I assume it is not.
>
>Hi Viv,
>
>I want to verify my code with you:
>
>
> private byte[] _webGrpImg = new byte[0];
> public byte[] Webgrpimg { get { return _webGrpImg; }
> set { value = _webGrpImg;
> if (value.Length>0)
> {
> Webgrpimgd = DateTime.Now;
> }
> }
> }// webgrpimg. Group logo
>
> public DateTime? Webgrpimgd { get; set; } // webgrpimgd. Datetime stamp the group logo image was last updated
>
>will it only set date when I actually changed the image or it will always set the date? E.g. is this code OK or it's better to add some other means of checking if the image was added / changed?
Rob has pointed out the problems. I'd only add (though not really knowing the context) that it may make sense to not give Webgrpimgd a public setter so that it could *only* be changed via the Webgrpimg setter. Bear in mind there's no downside to providing your own backing field - if you don't then it's what .NET does anyway....