Dharmang
Dharmang
CC#
Created by Dharmang on 12/13/2023 in #help
Web API - Get Payload in body as well as the uploaded File using Ardalis Endpoints
6 replies
CC#
Created by Dharmang on 12/13/2023 in #help
Web API - Get Payload in body as well as the uploaded File using Ardalis Endpoints
Also have added comments on what i needed to do in the project 🙂
6 replies
CC#
Created by Dharmang on 12/13/2023 in #help
Web API - Get Payload in body as well as the uploaded File using Ardalis Endpoints
No description
6 replies
CC#
Created by Dharmang on 12/13/2023 in #help
Web API - Get Payload in body as well as the uploaded File using Ardalis Endpoints
@ardalis can you help with this... not able to find anything related to this?
6 replies
CC#
Created by stubby on 11/23/2023 in #help
how to scrape tweets?
this is such a chatgpt question 😄
5 replies
CC#
Created by Aubrey on 11/23/2023 in #help
endless loop
why handle negative? mod everything and if the stop is a negative inverse the output.
21 replies
CC#
Created by AdiZ on 11/22/2023 in #help
Absolute Beginner - Accessing Variables From Other Classes
it covers basically everything for beginners. I am also learning from it
94 replies
CC#
Created by AdiZ on 11/22/2023 in #help
Absolute Beginner - Accessing Variables From Other Classes
Altho a bit late, I suggest watching tarodev's videos. Excellent resource and he also has a discord. https://www.youtube.com/watch?v=tE1qH8OxO2Y
94 replies
CC#
Created by Airsicktitan on 11/22/2023 in #help
✅ @onchange event not triggering
Undefined is also a string. this aint javascript where its a keyword. if your requirement is like setting default names to Undefined then its fine
13 replies
CC#
Created by Airsicktitan on 11/22/2023 in #help
✅ @onchange event not triggering
"Undefined" this is wrong! use string.Empty. And why are you using linq? To just learn then its fine but if not then use the Find method which will directly return based on the Person Id. is it enforcing to send you string? @person.Id.ToString() if not just send int so it will be filtered easily
13 replies
CC#
Created by nanz on 11/22/2023 in #help
Winui 3 titlebar problems
@nanz are you able to set this directly like you do in c#? ExtendsContentIntoTitleBar = true; SetTitleBar(TitleBar); If not try above by setting title bar again
5 replies
CC#
Created by ! 휘백 on 11/22/2023 in #help
✅ I can't use "Console" class
117 replies
CC#
Created by ! 휘백 on 11/22/2023 in #help
✅ I can't use "Console" class
well thats the issue
117 replies
CC#
Created by ! 휘백 on 11/22/2023 in #help
✅ I can't use "Console" class
do you have adobe creative cloud?
117 replies
CC#
Created by dreadfullydistinct on 11/21/2023 in #help
Converting from a string to a generic method invocation
then you use if else statements, along with LookupEnum.FromString(entity) and you can also put validations if the mapping fails
12 replies
CC#
Created by dreadfullydistinct on 11/21/2023 in #help
Converting from a string to a generic method invocation
switch statement needs compiled value and not a generated one. you can use and enum. I have used it before and it works well. sharing one sample enum which maps to strings.
using Microsoft.Kiota.Abstractions.Extensions;

namespace YOURNAMESPACE
{
public class LookupEnum
{
public static LookupEnum States { get; } = new LookupEnum(9, nameof(States).ToFirstCharacterLowerCase()!);
public static LookupEnum Clients { get; } = new LookupEnum(10, nameof(Clients).ToFirstCharacterLowerCase()!);

public string Name { get; private set; }
public int Value { get; private set; }

private LookupEnum(int val, string name)
{
Value = val;
Name = name;
}

public static IEnumerable<LookupEnum> List()
{
return new[]
{
States,
Clients
};
}

public static LookupEnum? FromString(string values)
{
try
{
return List().Single(r => string.Equals(r.Name, values, StringComparison.OrdinalIgnoreCase));
}
catch
{
return null;
}
}

public static LookupEnum FromValue(int value)
{
return List().Single(r => r.Value == value);
}

public static IEnumerable<LookupEnum> FromStrings(string[] values)
{
return values.Select(FromString).Where(value => value != null)!;
}
}
}
using Microsoft.Kiota.Abstractions.Extensions;

namespace YOURNAMESPACE
{
public class LookupEnum
{
public static LookupEnum States { get; } = new LookupEnum(9, nameof(States).ToFirstCharacterLowerCase()!);
public static LookupEnum Clients { get; } = new LookupEnum(10, nameof(Clients).ToFirstCharacterLowerCase()!);

public string Name { get; private set; }
public int Value { get; private set; }

private LookupEnum(int val, string name)
{
Value = val;
Name = name;
}

public static IEnumerable<LookupEnum> List()
{
return new[]
{
States,
Clients
};
}

public static LookupEnum? FromString(string values)
{
try
{
return List().Single(r => string.Equals(r.Name, values, StringComparison.OrdinalIgnoreCase));
}
catch
{
return null;
}
}

public static LookupEnum FromValue(int value)
{
return List().Single(r => r.Value == value);
}

public static IEnumerable<LookupEnum> FromStrings(string[] values)
{
return values.Select(FromString).Where(value => value != null)!;
}
}
}
Obtained from an article by Steve (you might know him from Ardalis Endpoints)
12 replies
CC#
Created by dreadfullydistinct on 11/21/2023 in #help
Converting from a string to a generic method invocation
its a simple approach where you dont use switch case 😄
12 replies
CC#
Created by dreadfullydistinct on 11/21/2023 in #help
Converting from a string to a generic method invocation
cause i recently had to change the efcore code to dapper queries as dynamic Entities are not supported. if its a local c# entity then all good
12 replies
CC#
Created by dreadfullydistinct on 11/21/2023 in #help
Converting from a string to a generic method invocation
One question, do you use ef core?
12 replies
CC#
Created by Shiv on 11/21/2023 in #help
Auto refresh inside windows form
maybe dispose absolutely clears the initiated object
20 replies