Click here to Skip to main content
15,510,678 members
Home / Discussions / C#
   

C#

 
GeneralRe: Parentheses vs curly brackets Pin
Gerry Schmitz3-Jan-18 6:13
mveGerry Schmitz3-Jan-18 6:13 
GeneralRe: Parentheses vs curly brackets Pin
Pete O'Hanlon26-Dec-17 23:26
mvaPete O'Hanlon26-Dec-17 23:26 
AnswerRe: Parentheses vs curly brackets Pin
BillWoodruff26-Dec-17 16:31
mveBillWoodruff26-Dec-17 16:31 
GeneralRe: Parentheses vs curly brackets Pin
User9874326-Dec-17 19:10
professionalUser9874326-Dec-17 19:10 
AnswerRe: Parentheses vs curly brackets Pin
Nathan Minier27-Dec-17 7:32
professionalNathan Minier27-Dec-17 7:32 
GeneralRe: Parentheses vs curly brackets Pin
User9874327-Dec-17 10:03
professionalUser9874327-Dec-17 10:03 
GeneralRe: Parentheses vs curly brackets Pin
Nathan Minier27-Dec-17 10:10
professionalNathan Minier27-Dec-17 10:10 
QuestionSerialize class with multiple different schemas Pin
hpjchobbes26-Dec-17 3:53
hpjchobbes26-Dec-17 3:53 
I have an API that I am trying to use that uses XML for it's requests. Each of these objects have multiple different requests (Add, Modify, and Delete), along with different versions that may exclude some fields. Is there a way to utilize serialization with different schema to account for these differences? For example, using the following Customer object:
C#
public class Customer
{
    public int ID;
    public string EditSequence;
    public string Name;
    public bool IsActive;
    public int? ParentID;
}
On a Delete request, I have to only supply the ID and the EditSequence fields. If I include the other fields, I get an error. For an Add I need to include all of them. Also, for null fields, they can not be included at all (i.e. no <parent> element). I don't think this is possible with regular XML serialization and I'll probably have to code this myself. If so, I was thinking of using custom attributes and reflection. Is there perhaps a better way to accomplish what I am trying?
AnswerRe: Serialize class with multiple different schemas Pin
BillWoodruff26-Dec-17 6:25
mveBillWoodruff26-Dec-17 6:25 
GeneralRe: Serialize class with multiple different schemas Pin
hpjchobbes27-Dec-17 4:20
hpjchobbes27-Dec-17 4:20 
GeneralRe: Serialize class with multiple different schemas Pin
Pete O'Hanlon27-Dec-17 5:05
mvaPete O'Hanlon27-Dec-17 5:05 
AnswerRe: Serialize class with multiple different schemas Pin
jschell26-Dec-17 8:28
jschell26-Dec-17 8:28 
AnswerRe: Serialize class with multiple different schemas Pin
Gerry Schmitz26-Dec-17 13:49
mveGerry Schmitz26-Dec-17 13:49 
GeneralRe: Serialize class with multiple different schemas Pin
hpjchobbes27-Dec-17 4:26
hpjchobbes27-Dec-17 4:26 
GeneralRe: Serialize class with multiple different schemas Pin
Gerry Schmitz28-Dec-17 7:28
mveGerry Schmitz28-Dec-17 7:28 
QuestionType Casting from OleDb Value Types Returns Invalid Cast Exception Pin
User9874326-Dec-17 0:09
professionalUser9874326-Dec-17 0:09 
AnswerRe: Type Casting from OleDb Value Types Returns Invalid Cast Exception Pin
Gerry Schmitz26-Dec-17 13:28
mveGerry Schmitz26-Dec-17 13:28 
GeneralRe: Type Casting from OleDb Value Types Returns Invalid Cast Exception Pin
User9874326-Dec-17 13:52
professionalUser9874326-Dec-17 13:52 
GeneralRe: Type Casting from OleDb Value Types Returns Invalid Cast Exception Pin
User9874326-Dec-17 14:02
professionalUser9874326-Dec-17 14:02 
QuestionAwait/Async Question Pin
Kevin Marois24-Dec-17 11:51
professionalKevin Marois24-Dec-17 11:51 
AnswerRe: Await/Async Question Pin
Dave Kreskowiak24-Dec-17 16:15
mveDave Kreskowiak24-Dec-17 16:15 
GeneralRe: Await/Async Question Pin
Kevin Marois24-Dec-17 16:22
professionalKevin Marois24-Dec-17 16:22 
QuestionGetting a list of Key pressed Pin
Kenneth Haugland22-Dec-17 10:52
mvaKenneth Haugland22-Dec-17 10:52 
AnswerRe: Getting a list of Key pressed Pin
Kenneth Haugland23-Dec-17 6:10
mvaKenneth Haugland23-Dec-17 6:10 
AnswerRe: Getting a list of Key pressed Pin
Gerry Schmitz23-Dec-17 6:58
mveGerry Schmitz23-Dec-17 6:58 

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.