Click here to Skip to main content
15,897,704 members
Home / Discussions / C#
   

C#

 
AnswerRe: Highscore Pin
Abhinav S9-Oct-10 17:44
Abhinav S9-Oct-10 17:44 
AnswerRe: Highscore Pin
Richard MacCutchan9-Oct-10 21:49
mveRichard MacCutchan9-Oct-10 21:49 
QuestionMarshalling a structure to contain an array whose length is an earlier struct member? Pin
o m n i9-Oct-10 9:33
o m n i9-Oct-10 9:33 
AnswerRe: Marshalling a structure to contain an array whose length is an earlier struct member? Pin
OriginalGriff10-Oct-10 0:19
mveOriginalGriff10-Oct-10 0:19 
QuestionAn attempt was made to access the socket in a way forbidden by its access permissions Pin
ars.029-Oct-10 8:02
ars.029-Oct-10 8:02 
AnswerRe: An attempt was made to access the socket in a way forbidden by its access permissions Pin
Richard MacCutchan9-Oct-10 21:47
mveRichard MacCutchan9-Oct-10 21:47 
AnswerRe: An attempt was made to access the socket in a way forbidden by its access permissions Pin
Dave Kreskowiak10-Oct-10 3:19
mveDave Kreskowiak10-Oct-10 3:19 
QuestionA question on wcf and composite objects Pin
Michael Eber9-Oct-10 7:20
Michael Eber9-Oct-10 7:20 
This is my scenario: I have a huge database and I'm building numerous services to access the data.
Each service exposes a unique set of data and services to the consumer.

So for an object such as Company our internal service needs the raw address in the composite. However our portal service need fully enumerated Address info in the composite.

I wanted to avoid having a massive object with various composite addon's that don't apply to a given object but I'm running into difficulties.

First I decided that each composite builder class will be in a namespace deeper than the data namespace. So instead of myApp.Data it would be myApp.Data.Mainservice and myApp.Data.Portalservice for the composite objects.

My next step was to inherit Company, add a constructure that takes Company as input to populate internal fields, and add the DataMember for each Composite that is needed. Works great but I get a runtime error that I cannot inherit an object that is not marked as Serializable or DataContract.

Initially I just added a public partial class Customer and added the DataContract attribute, but that does not expose the DataMembers inside of the object.

I also cannot use the partial class definition as I need to be inside the namespace of the Customer object which puts me back into the same problem of having an accumulation of composite objects.


For those who need pictures here is the code I want to implement:
namespace Company.Data.InternalServices
{
     [DataContract]
     public sealed class CompositeLocation : Company.Data.Location
     {

           [DataMember]
           public Address LocationAddress{get;set;}

      }


[ServiceContract]
public class InternalContract:IInternalContract
{
     [OperationContract]
     public CompositeLocation GetLocation( Guid LocationIdentity );
}

}

namespace Company.Data.Portal
{
      [DataContract]
      public sealed class CompositeLocation:Location
      {
            [DataMember]
             public EnumeratedAddress{get;set;}
       }

      [ServiceContract]
      public class PortalContract:IPortalContract
      {
           [OperationContract]
           public CompositeLocation GetLocation(Guid LocationIdentity);
       }
 }


When no method returns a Location, WCF drops the DataContract for Location. I want to force it to keep Location as a data contract!!! Cool | :cool:
Questionwhich way better for activation? Pin
Jassim Rahma9-Oct-10 5:21
Jassim Rahma9-Oct-10 5:21 
AnswerRe: which way better for activation? PinPopular
DaveAuld9-Oct-10 6:04
professionalDaveAuld9-Oct-10 6:04 
GeneralRe: which way better for activation? Pin
OriginalGriff9-Oct-10 6:15
mveOriginalGriff9-Oct-10 6:15 
GeneralRe: which way better for activation? Pin
Luc Pattyn9-Oct-10 7:13
sitebuilderLuc Pattyn9-Oct-10 7:13 
GeneralRe: which way better for activation? Pin
OriginalGriff9-Oct-10 7:16
mveOriginalGriff9-Oct-10 7:16 
AnswerRe: which way better for activation? Pin
OriginalGriff9-Oct-10 6:19
mveOriginalGriff9-Oct-10 6:19 
QuestionAssign By Reference Pin
thenutz729-Oct-10 4:08
thenutz729-Oct-10 4:08 
AnswerRe: Assign By Reference Pin
PIEBALDconsult9-Oct-10 4:18
mvePIEBALDconsult9-Oct-10 4:18 
GeneralRe: Assign By Reference Pin
harold aptroot9-Oct-10 4:45
harold aptroot9-Oct-10 4:45 
AnswerRe: Assign By Reference [modified] Pin
Keith Barrow9-Oct-10 6:28
professionalKeith Barrow9-Oct-10 6:28 
GeneralRe: Assign By Reference Pin
thenutz729-Oct-10 8:45
thenutz729-Oct-10 8:45 
GeneralRe: Assign By Reference Pin
PIEBALDconsult9-Oct-10 9:07
mvePIEBALDconsult9-Oct-10 9:07 
GeneralRe: Assign By Reference Pin
Keith Barrow9-Oct-10 9:33
professionalKeith Barrow9-Oct-10 9:33 
AnswerRe: Assign By Reference Pin
Eddy Vluggen9-Oct-10 6:55
professionalEddy Vluggen9-Oct-10 6:55 
AnswerRe: Assign By Reference Pin
Bernhard Hiller10-Oct-10 23:14
Bernhard Hiller10-Oct-10 23:14 
Questionencrypt App.config Pin
Jassim Rahma9-Oct-10 2:55
Jassim Rahma9-Oct-10 2:55 
AnswerRe: encrypt App.config Pin
Abhinav S9-Oct-10 3:07
Abhinav S9-Oct-10 3:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.