sneezey
sneezey
CC#
Created by julian on 8/3/2023 in #help
❔ ASP.NET Core Web API with Auth0
5 replies
CC#
Created by Shiv on 7/31/2023 in #help
❔ Real time communication
the client apps will state their id
well technically, they should give an auth token that the server knows about, connecting that to their user id
12 replies
CC#
Created by sneezey on 7/26/2023 in #help
❔ NSubstitute on IEnumerable
I assume it's something to do with IEnumerable being a type that it creates even before trying to freeze?
3 replies
CC#
Created by SWEETPONY on 7/20/2023 in #help
✅ How to call base implementation in abstract class?
🙌
41 replies
CC#
Created by SWEETPONY on 7/20/2023 in #help
✅ How to call base implementation in abstract class?
like that - the first word from public to protected
41 replies
CC#
Created by SWEETPONY on 7/20/2023 in #help
✅ How to call base implementation in abstract class?
protected abstract void FillSchemaDetails(
UISchemaItem schemaItem,
PropertyInfo property,
CultureInfo culture);
protected abstract void FillSchemaDetails(
UISchemaItem schemaItem,
PropertyInfo property,
CultureInfo culture);
41 replies
CC#
Created by SWEETPONY on 7/20/2023 in #help
✅ How to call base implementation in abstract class?
^ this i was giving another option, but doing base. is the right thing
41 replies
CC#
Created by SWEETPONY on 7/20/2023 in #help
✅ How to call base implementation in abstract class?
you cant have public + protected at the same time 😅
41 replies
CC#
Created by SWEETPONY on 7/20/2023 in #help
✅ How to call base implementation in abstract class?
happy to be told otherwise 😆
41 replies
CC#
Created by SWEETPONY on 7/20/2023 in #help
✅ How to call base implementation in abstract class?
I think you can make FillSchemaDetails protected, then it forces usage on the FillSchema and wont be tempted to use FillSchemaDetails?
41 replies
CC#
Created by SWEETPONY on 7/20/2023 in #help
✅ How to call base implementation in abstract class?
ohh, i see what you mean 😂 for the markdown language support ```csharp <code> ```
41 replies
CC#
Created by SWEETPONY on 7/20/2023 in #help
✅ How to call base implementation in abstract class?
...? language? you know what server we're in right? 😹
41 replies
CC#
Created by SWEETPONY on 7/20/2023 in #help
✅ How to call base implementation in abstract class?
not sure how right I am, but: You could make a new method that the new functionality overrides, but is a protected keyword method? then the FillSchema can call the new method, then you don't need to remember the base.FillSchema(...)
41 replies
CC#
Created by sneezey on 6/6/2023 in #help
❔ Weird Type comparison always false
This was fixed by changing
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
to
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0">
<ExcludeAssets>runtime</ExcludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0">
<ExcludeAssets>runtime</ExcludeAssets>
</PackageReference>
39 replies
CC#
Created by sneezey on 6/6/2023 in #help
❔ Weird Type comparison always false
But fair enough - I'll keep trying
39 replies
CC#
Created by sneezey on 6/6/2023 in #help
❔ Weird Type comparison always false
Unfortunately I don't - I have access 5o Project.Two, but not One 😔
39 replies
CC#
Created by sneezey on 6/6/2023 in #help
❔ Weird Type comparison always false
Now I don't want Foo to have access to the service provider, but a "vetted" subset of items that I want it allowed access to such as the ILogger
39 replies
CC#
Created by sneezey on 6/6/2023 in #help
❔ Weird Type comparison always false
the aim being Bar will create Foo if the Foo wants an ILogger
39 replies
CC#
Created by sneezey on 6/6/2023 in #help
❔ Weird Type comparison always false
nah that won't work either essentially i have:
namespace Project.One;
public class Foo : IFoo
{
public Foo(ILogger<Foo> logger){ ... }
}
namespace Project.One;
public class Foo : IFoo
{
public Foo(ILogger<Foo> logger){ ... }
}
namespace Project.Two;
class Bar
{
public Bar(Type ifoo, IServiceProvider serviceProvider)
{
var factory = serviceProvider.GetService<ILoggerFactory>();
var logger = factory.CreateLogger(ifoo);

var hasLogger = ifoo.GetConstructors().Single().GetParameters();

if (hasLogger)
Activator.CreateInstance(ifoo, new object[]{ logger });
}
else
{
Activator.CreateInstance(ifoo, null);
}
}
}
namespace Project.Two;
class Bar
{
public Bar(Type ifoo, IServiceProvider serviceProvider)
{
var factory = serviceProvider.GetService<ILoggerFactory>();
var logger = factory.CreateLogger(ifoo);

var hasLogger = ifoo.GetConstructors().Single().GetParameters();

if (hasLogger)
Activator.CreateInstance(ifoo, new object[]{ logger });
}
else
{
Activator.CreateInstance(ifoo, null);
}
}
}
39 replies
CC#
Created by sneezey on 6/6/2023 in #help
❔ Weird Type comparison always false
i've tried with GetGenericTypeDefinition
39 replies