© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
9 replies
nulled

❔ using data received from a Post to determine what property to set

Below will be attached text of two classes, one called PostReceiveStruct and the other UserAccount.

UserAccount holds the structed for a json format that can be turned into an object.

PostReceiveStruct holds the structure for how data received from a post request can be turned into an object as well

Both of these classes work to what I need them for, what I would like to know is how can use DCName's value to use in UserAccount

The easiest example that I can think of is something like what they do in rLua.

local DCName = "version"
UserAccount[DCName]
local DCName = "version"
UserAccount[DCName]


public class PostReceiveStruct
    {
        public ulong uid { get; set; }
        public string DCName { get; set; }
        public string DCValue { get; set; }
    }
public class PostReceiveStruct
    {
        public ulong uid { get; set; }
        public string DCName { get; set; }
        public string DCValue { get; set; }
    }


public class Medal
    {
        public string name { get; set; }
        public int awarded { get; set; }
        public int permission { get; set; }
    }
    public class BranchMedals
    {
        public List<Medal> medal { get; set; }
    }
    public class BranchList
    {
        public List<BranchMedals> branches { get; set; }
    }
    public class UserAccount
    {
        public ulong RID { get; set; }
        public ulong ID { get; set; }
        public string version { get; set; }
        public dynamic medals {get;set;}
    }
public class Medal
    {
        public string name { get; set; }
        public int awarded { get; set; }
        public int permission { get; set; }
    }
    public class BranchMedals
    {
        public List<Medal> medal { get; set; }
    }
    public class BranchList
    {
        public List<BranchMedals> branches { get; set; }
    }
    public class UserAccount
    {
        public ulong RID { get; set; }
        public ulong ID { get; set; }
        public string version { get; set; }
        public dynamic medals {get;set;}
    }
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

✅ Better way to set a property using linq?
C#CC# / help
16mo ago
❔ Access a DB property from a not mapped property
C#CC# / help
3y ago
❔ How to deal with property’s that need data from a database?
C#CC# / help
4y ago