Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Public properties without extra private property
Message
From
07/10/2014 18:03:25
John Baird
Coatesville, Pennsylvania, United States
 
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01608537
Message ID:
01608957
Views:
31
>>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?
>
>Thanks.

The spelling of your property names should be the same for the exception of the leading character. It should be Private _webGrpImg and Public WebGrpImg......
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform