Hi,
this is possible a very common question, but searching the forums and reading through the documentation still left me kind of clueless of how to accomplish the following scenario:
i have two tables:
theese translate to "MainCategories" and "SubCatergories".
I further have the following sproc, that returns a joined resultset from theese tables:
set
ANSI_NULLS ONset
QUOTED_IDENTIFIER ONGO
ALTER
PROCEDURE [dbo].[spG_LeseWarengruppenMitObergruppen] ASSELECT W.ID,W
.Bezeichnung AS 'Warengruppe',O
.Bezeichnung AS 'WarenObergruppe'FROM tbWarengruppen W INNER JOIN tbWarenObergruppen O ON W.tbWarenObergruppen_ID = O.ID
Now how would i got to get this resultset into a BO ? When i use the BO-Mapper, i can only select a table from the database directly.
I read the portion about custom field properties aswell and at first thought that was what i been looking for. For a quick test i wrote the following custom property field code into the bo code:
#region Custom Field Properties
[Browsable(true), BusinessFieldDisplayInEditor(), Description("WarenObergruppe"), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string WarenObergruppe
{
get { return this.WarenObergruppe; }
}
protected override MicroFour.StrataFrame.Business.FieldPropertyDescriptor[] GetCustomBindablePropertyDescriptors()
{
return new FieldPropertyDescriptor[] { new ReflectionPropertyDescriptor("WarenObergruppe", typeof(WarengruppenBO)) };
}
#endregion
My Impression was, that this custom field property would now appear inside the buisness object mapper along with the other fields, and that i could just rename the field "Bezeichnung" to Warengruppe aswell as "removing" the fields ID and tbWarenObergruppen_ID to match up with the resultset that my sproc returns.
however, both assumtions turned out to be wrong.
So the question remains:
how do i "map" my sproc's resultset to a BO ?
Thanks.