Multiple Tables in an object


Author
Message
Robert Harvey
Robert Harvey
StrataFrame Beginner (19 reputation)StrataFrame Beginner (19 reputation)StrataFrame Beginner (19 reputation)StrataFrame Beginner (19 reputation)StrataFrame Beginner (19 reputation)StrataFrame Beginner (19 reputation)StrataFrame Beginner (19 reputation)StrataFrame Beginner (19 reputation)StrataFrame Beginner (19 reputation)
Group: Forum Members
Posts: 9, Visits: 28
Let's say I have a strongly-typed dataset that contains multiple tables.  And, let's call this dataset 'Orders'.  How can I create an object with Strata-frame?  All of the documentation points to one table per object.  Not that the attachment is a 'real-life' example.  But, I don't want to upload what I use at our company for public consumption.
Attachments
XSDSchema1.zip (181 views, 1,013 bytes)
Replies
choyt
choyt
StrataFrame User (132 reputation)StrataFrame User (132 reputation)StrataFrame User (132 reputation)StrataFrame User (132 reputation)StrataFrame User (132 reputation)StrataFrame User (132 reputation)StrataFrame User (132 reputation)StrataFrame User (132 reputation)StrataFrame User (132 reputation)
Group: Forum Members
Posts: 78, Visits: 246
Hi Folks

I have this working with one caveat.

I have a "Users" table that hold basic inforamtion such as First and Last name but am using forms authentication and want to take full advantage of that so am using the aspnet_ tables as well. To do this, I am joining together my Users table with aspnet_Users and aspnet_Membership. There is no data of use to me in the aspnet_Users table but there is quite a bit of useful info in the membership table.

To do this the way that has been described, I am customizing the UserName field in my user table (the FK to the UserName field in aspnet_Users) and replacing it with a BO that I mapped against aspnet_membership. I would much rather keep my user name field intact but there is no way in the object mapper to create a field. You can only use (override) fields that are aleady part of the underlying database table.

I can see these work arounds

  1. Create a "fake" field in the database to fool the mapper into believing there is an extra field.
  2. Manually modify the designer.vb file each time I do a build (kind of pain but not out of the question)
  3. Overwriting my UserName field.

Is there something simple and basic I'm missing or is my understanding correct?

Thanks! BigGrin

StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
If you want to override a field property that maps to a field in the database, then you will need to use the Custom Code option within the BOMapper and supply the code that you want it to spit out when it creates the partial class.

If you want to create a second property (instead of replacing the property itself), you'll want to create a new property in the main code file so that it does not get overwritten when the partial class is re-created again.  The easiest way to do this is to copy one of the fields from the designer file, paste it into the main code file (attributes and all) and modify it the way you want it.  Then, just override the GetCustomBindablePropertyDescriptors() method and return the property descriptor for that property.  (You should be able to search either the help or the forum for "GetCustomBindablePropertyDescriptors" because it might show you some more information and show you what happens when you don't provide a descriptor BigGrin).

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Robert Harvey - 20 Years Ago
StrataFrame Team - 20 Years Ago
Daniel Essin - 20 Years Ago
Robert Harvey - 20 Years Ago
                 But, you can post in C#. Either way works for me.
Robert Harvey - 20 Years Ago
StrataFrame Team - 20 Years Ago
StrataFrame Team - 20 Years Ago
Michael Cobb - 18 Years Ago
StrataFrame Team - 18 Years Ago
Charles R Hankey - 18 Years Ago
StrataFrame Team - 18 Years Ago
Charles R Hankey - 18 Years Ago
StrataFrame Team - 18 Years Ago
Charles R Hankey - 18 Years Ago
Michael Cobb - 18 Years Ago
Charles R Hankey - 18 Years Ago
StrataFrame Team - 18 Years Ago
Michael Cobb - 18 Years Ago
Michael Cobb - 18 Years Ago
choyt - 18 Years Ago
StrataFrame Team - 18 Years Ago
choyt - 18 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search