All Questions
294
questions
0
votes
1
answer
141
views
How to find out the size of an object recursively in c#?
I have a complex object with properties that range from int, double, string, List of objects, Dictionary<sting, dynamic> ,etc. How can I calculate the size of this object (without using GC) ?
I'...
0
votes
1
answer
54
views
A property in Child Object in Parent Object-A is changed when a new property in Child Object in Parent Object-B is added
Consider this object
{
"ClassId": 101,
"Sections": [
{
"SectionId": 201,
"Subjects": [
{
...
2
votes
2
answers
279
views
Getting all values of properties of an object into an array in c#
Im trying to get all the field values of an object into an array. but the problem is the fields of the object can have other types rather than string but ultimately all the values should be a string.
...
0
votes
2
answers
88
views
List<object>: how to apply a "where" for some index element?
I've this kind of List of object:
.AsEnumerable().Select(p => new List<object>()
{
p.ID,
p.DateActivity.HasValue ? p.DateActivity.Value.ToString("yyyyMMdd") : null,
p....
-1
votes
2
answers
43
views
Need clarity over what happens when you cast an object to value or reference type compared to using Dynamic in a class property, Using C#
So have this property Value in a class.
I need an interchangeable type of property for Value as wont know the type until it arrives from the DB and can be either reference or value type
(see examples ...
0
votes
0
answers
117
views
How to convert list of objects into string and then into byte array
The list contains two objects or more I want to create string with the name of its properties and values.
async Task<string> ICsvHandler.CsvHandler()
{
var employees = new List<...
0
votes
1
answer
94
views
C# - Object without '= new Kid()'
Goodmorning.
How is it possible at the line 28 and 29 the kd has the ability to use the property and the function without using 'Kid kd = new Kid();' at the line 24.
Normally i get the error at the ...
0
votes
1
answer
61
views
Using a subset of an object in different services
lets say that I have a system that heavily relies on a single object, for example a Person.
I have a storage service (service 1) that handles basic CRUD operations for Person, and saves this person in ...
0
votes
1
answer
228
views
How to get data from an Object from another Class?
Hey I have a problem with my code.
Sorry if the question is too easy but I can't find a solution.
I have an object called user in class 1
The Object User has this variables.
public class User
{
...
-2
votes
1
answer
330
views
Convert JSON file into multiple class objects in C#
I'm trying to make a program in C# that allows me to edit level data in JSON:
{
"ambienceSettings": {
"fogDDensity": 0.57235307,
"skyHorizonColor": {
...
0
votes
2
answers
83
views
Can you change the default value for a user created class c#
I'm making a game and the background is made of Tile objects. The Tile parent is abstract but I have Tile arrays to hold the children. When I make a Tile array I want it to assume that any unspecified ...
-1
votes
1
answer
489
views
AutoMapper - Map from object to enum
I have this class:
public class EntityClass
{
public bool IsExempt { get; set; }
public bool IsOverdue { get; set; }
public SourceEnum Status { get; set; }
}
And these two enums:
public ...
1
vote
1
answer
2k
views
How can we deserialize JSON data to c# object from API response
I need to deserialize my json data. I am using Newtonsoft.Json for json operations. I tried a lot of method to deserialize this data but i failed. Btw, I need to summarize my system for better ...
0
votes
3
answers
518
views
Method that takes two different objects
So i have two different objects, with different properties:
public class ModelA : IServices
{
public string Id { get; set; }
public ServiceType ServiceType { get; set; } (Enum)
...
0
votes
0
answers
226
views
object reference not set to an instance of an object : source
I have an object named "groupRead", which is null so that's why it's throwing an exception of "object reference not set to an instance of an object" when I'm trying to access this ...