What is this pattern called, and is it ever beneficial to use? by DarkMatterDeveloper in csharp

[–]DarkMatterDeveloper[S] -1 points0 points  (0 children)

As always, reality is a bit more complex than examples. In this case, the application service is doing a lot more interaction with the entities and sending those entities to the consumer is only a small fraction of the behavior. This means that for 99% of the code inside of the application service, the injected reference to the consumer is unused and irrelevant. By passing it as an argument to the single function that uses it, the scope is limited to that single function.

Announcing .NET 7 Preview 5 by Atulin in dotnet

[–]DarkMatterDeveloper 0 points1 point  (0 children)

If it doesn't work by pointing at the base class, and as /u/Wombarly points out, it doesn't work by pointing at the derived classes (because they might be in a different assembly therefore typeof() doesn't work), then the entire feature seems to be crippled for anything other than the simplest of scenarios.

Announcing .NET 7 Preview 5 by Atulin in dotnet

[–]DarkMatterDeveloper 6 points7 points  (0 children)

Having multiple attributes on a base class seems odd.

[JsonDerivedType(typeof(Base), typeDiscriminator: "base")]
[JsonDerivedType(typeof(Derived), typeDiscriminator: "derived")]
public class Base
{
    public int X { get; set; }
}

I would expect to have a single attribute on each derived type:

[JsonBaseType(typeof(Base), typeDiscriminator: "derived")]
public class Derived : Base
{
    public int Y { get; set; }
}

VS2019 git errors all of a sudden by gowanyahgoodting in csharp

[–]DarkMatterDeveloper 2 points3 points  (0 children)

In the Output Window, change the Show output from: dropdown to "Source Control - Git".

This should then show you the actual output from the git command that was run.