datacontract Questions

2

Solved

This MSDN article recommends always to provide a namespace to a ServiceContract and DataContract. Examples usually have a "schema" prefix and a URI type pattern for the namespace such as Namespa...
Lodged asked 19/3, 2014 at 20:3

4

Solved

I have a simple class I'm serializing. [DataContract(Name = "Test", Namespace = "")] public class Test { [DataMember(Order = 0, Name = "Text")] public string Text { get; set; } public Test(...
Grinder asked 29/10, 2009 at 14:10

4

Solved

Good day everyone, I'm an independent game developer who has, in the past, primarily worked with XNA and, at the other extreme, commercial toolsets. The reach of XNA is pretty limited, however, an...
Plashy asked 20/6, 2012 at 8:40

2

Solved

i have two data classes which hold only data members(no functions). One is CallTask the other is SmsTask. These two classes have some common properties like ID, Tel. I put these common properties ...
Entreat asked 2/4, 2012 at 8:0

3

Solved

I am going to use Entity Framework and WCF in my application. The suggested practice, as I saw, is using POCO with Entity Framework and also using POCO classes as DataContracts. That is actually wh...
Unrestrained asked 21/9, 2010 at 12:27

6

Solved

I have a WCF service method that expects an object and then retrieves its properties using reflection. On the client side I create an anonymous type object var obj = new {FirstName="John", Last...
Frijol asked 21/2, 2010 at 19:35

3

Solved

[DataContract] public class SearchCriteria { [DataMember] public string CountryID { get; set; } } [DataContract] public class CitySearchCriteria: SearchCriteria { [DataMember] public string C...
Fluted asked 6/5, 2013 at 5:56

3

Solved

I'm using DataContractSerializer to serialize/deserialize my classes to/from XML. Everything works fine, but at some point I'd like to establish a standard schema for the format of these XML files ...
Mythicize asked 8/4, 2010 at 23:2

3

Solved

I have a class that I need to be able to serialize to a SQLServer session variable and be available over a WCF Service. I have declared it as follows namespace MyNM { [Serializable] [DataContract...
Mashie asked 17/3, 2010 at 10:33

4

Solved

I'm writing a serialization function that needs to determine whether class has DataContract attribute. Basically function will use DataContractSerializer if class has DataContract attribute, otherw...
Spout asked 18/7, 2011 at 14:25

2

I'm interested about the best way to go about setting custom element names when using List of primitives with the DataContractSerializer. Let's say I have the following class which contains a List ...

3

Solved

How can I effectively serialize a property of type "Type" in my DataContract attributed class? I'm assuming that Type is a non-serializable Type (wow that's getting silly sounding.) I'm sure that t...
Abercrombie asked 20/9, 2011 at 16:26

3

Solved

I have a web client that calls my WCF business service layer, which in turn, calls external WCF services to get the actual data. Initially, I thought I would use DTOs and have separate business ent...
Gumption asked 27/7, 2012 at 4:32

2

Solved

I have scoured the Net for info on this, but most of the results are about creating WCF services or situations where the service is under your control. I am building a WCF client proxy for a RESTf...
Mapes asked 4/1, 2013 at 14:35

2

How can I use a DataContractSurrogate for my WCF REST service (hosted using a WebServiceHostFactory)? I don't see a way of adding one and even if I add a custom IOperationBehavior, the WebServiceH...
Maiduguri asked 20/1, 2011 at 0:12

1

Solved

Many time i saw that developer are using DataContract and DataMember Attributes for their Asp.net Web API model? What are the differences and best practices?
Quilmes asked 30/12, 2012 at 8:44

1

Solved

I have a WCF data contract with a bunch of properties of primitive types like int and decimal, and DateTime (which is, of course, a struct). My co-worker suggested making them all nullable and th...
Paphlagonia asked 6/12, 2012 at 17:7

3

I am working on the UI of an app using typescript. At the same time others work on providing me data. We agreed on the data contract however the process is error prone and I keep getting inva...
Exfoliation asked 12/10, 2012 at 22:35

1

Solved

I have an enum annotated with EnumMember to facilitate JSON.NET serialization similar to the following: [DataContract] [JsonConverter(typeof(StringEnumConverter))] public enum Status { [EnumMembe...
Turnover asked 18/9, 2012 at 0:1

1

I have persisted an array of objects to a file using DataContractSerializer. It has been working fine until recently when I started getting the following message. Deserialized object with referenc...
Geomorphology asked 5/9, 2012 at 5:45

1

Solved

We are using DTOs as Data Contracts in our WCF web service. The purpose for these DTOs is to expose only the information that is relevant for a specific API method. What I am seeking from you guy...
Mima asked 16/8, 2012 at 1:54

1

Solved

I have defined the following DataContract which implements IDisposable: [DataContract] public class RegularFileMetadata : FileMetadataBase, IDisposable { bool _Disposed = false; //note this! //...
Papuan asked 9/7, 2012 at 6:43

3

Solved

If I have a class marked as a DataContract and a few properties on it marked with DataMember attributes I can serialize it out to XML easily, but it would create output like: <Person> <N...
Dys asked 26/2, 2009 at 18:47

2

I understand what is the attribute property IsReference and what it is doing. But I don't understand why/when I should not use it. When is it a bad idea to use IsReference=true? If my wcf service ...
Lintwhite asked 16/1, 2012 at 7:7

2

Solved

I have a ServiceContract which returns dynamic type and looks like following: public dynamic LoginViaOpenId(string openIdUrl) The dynamic return type could be a DataContract that I have defined,...
Sybilla asked 12/4, 2012 at 8:30

© 2022 - 2024 — McMap. All rights reserved.