Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Auto Properties in .Net

2 posts in General Discussion Last posting was on 2013-02-14 20:38:50.0Z
Randy Buchholz Posted on 2012-12-19 13:48:50.0Z
Sender: 6d63.50d1c16f.1804289383@sybase.com
From: Randy Buchholz
Newsgroups: sybase.public.powerdesigner.general
Subject: Auto Properties in .Net
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <50d1c5c2.6ea9.1681692777@sybase.com>
NNTP-Posting-Host: 172.20.134.41
X-Original-NNTP-Posting-Host: 172.20.134.41
Date: 19 Dec 2012 05:48:50 -0800
X-Trace: forums-1-dub 1355924930 172.20.134.41 (19 Dec 2012 05:48:50 -0800)
X-Original-Trace: 19 Dec 2012 05:48:50 -0800, 172.20.134.41
Lines: 25
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerdesigner.general:30969
Article PK: 1158489

Hi All, I would like to get PD to generate the .Net "Auto
Property" syntax in OO generation. I would like to get:

public string PropertyName{ get; set; }

for Properties instead of:.

private string propertyName;

public string PropertyName
{
get
{
return propertyName;
}
set
{
this.propertyName = value;
}
}

Anyone know if we'll see a .Net 3.5 or above library to
support things like this out-of-the-box? Also wondering
about SQL 2008R2. I use the HirerarchyId data type and PD
pukes on it.


randy.buchholz Posted on 2013-02-14 20:38:50.0Z
Sender: 768a.511d42bd.1804289383@sybase.com
From: randy.buchholz
Newsgroups: sybase.public.powerdesigner.general
Subject: Re: Auto Properties in .Net
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <511d4b5a.78a0.1681692777@sybase.com>
References: <50d1c5c2.6ea9.1681692777@sybase.com>
NNTP-Posting-Host: 172.20.134.41
X-Original-NNTP-Posting-Host: 172.20.134.41
Date: 14 Feb 2013 12:38:50 -0800
X-Trace: forums-1-dub 1360874330 172.20.134.41 (14 Feb 2013 12:38:50 -0800)
X-Original-Trace: 14 Feb 2013 12:38:50 -0800, 172.20.134.41
Lines: 31
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerdesigner.general:31009
Article PK: 1307664

Found the trick. create an attribute and set the stereotype
of Property (Don't use the "add property" or you need to do
additional work). It will create getter/setter operations.
Open the operation and in the Implementation just put a ';'
no brackets just the on char. Works pretty good.

> Hi All, I would like to get PD to generate the .Net "Auto
> Property" syntax in OO generation. I would like to get:
>
> public string PropertyName{ get; set; }
>
> for Properties instead of:.
>
> private string propertyName;
>
> public string PropertyName
> {
> get
> {
> return propertyName;
> }
> set
> {
> this.propertyName = value;
> }
> }
>
> Anyone know if we'll see a .Net 3.5 or above library to
> support things like this out-of-the-box? Also wondering
> about SQL 2008R2. I use the HirerarchyId data type and PD
> pukes on it.