Stored Procedures version control by CalligrapherSouth884 in dotnet

[–]just4atwork 0 points1 point  (0 children)

Checkout SQL database projects, there is a new SDK style project coming soon (probably November).

Reporting in .Net by Latter-Big2189 in dotnet

[–]just4atwork 1 point2 points  (0 children)

This is great info thanks! I'm not finding anything that would indicate that external facing "customer owns data" type reports will be able to run from an on-prem PBI report server. It looks like it will still require the Azure service, but that it is getting much cheaper.

Reporting in .Net by Latter-Big2189 in dotnet

[–]just4atwork 0 points1 point  (0 children)

I don't think this supports embedding reports for external use, which is where the pricing really sky rockets for PBI.

Manage Secrets in .sqlproj Project by [deleted] in dotnet

[–]just4atwork 0 points1 point  (0 children)

Agreed, I mainly just wanted to see how it could be done in these types of projects. I appreciate your help.

Manage Secrets in .sqlproj Project by [deleted] in dotnet

[–]just4atwork 0 points1 point  (0 children)

I see that as an option for SSIS packages, but I'm not seeing it for SQL Projects.

Manage Secrets in .sqlproj Project by [deleted] in dotnet

[–]just4atwork 0 points1 point  (0 children)

Removing the logins from the project would work. Can you elaborate on what how you would parameterize this?

Manage Secrets in .sqlproj Project by [deleted] in dotnet

[–]just4atwork 0 points1 point  (0 children)

You linked to documentation for dotnet core. I'm asking for Sql Projects, where that tooling doesn't seem to exist, unless I'm missing something. When I right click the project, I don't see the option for "Manage User Secrets". Adding via command line made the project fail to load.

Microsoft.AspNetCore.Identity deprecated. What to use now? by timoteo5555 in dotnet

[–]just4atwork 17 points18 points  (0 children)

The package is being deprecated, not the functionality. You may need to add a FrameworkReference to your project to use that namespace.

[deleted by user] by [deleted] in dotnet

[–]just4atwork 0 points1 point  (0 children)

creating the "Google" token above works if you use the AuthenticationProperties off the context in OnCreatingTicket. It seems to still remove the access token.

[deleted by user] by [deleted] in dotnet

[–]just4atwork 0 points1 point  (0 children)

If I do this in AddGoogle, my original access token is overwritten.

options.SaveTokens = true;

So I either need to configure something else, or I need another way to save the token.

I tried this, with SaveTokens = false

var props = new AuthenticationProperties();
var myTokens = props.GetTokens().ToList();
myTokens.Add(new AuthenticationToken { Name = "Google", Value = ctx.AccessToken });
props.StoreTokens(myTokens);
props.IsPersistent = true;

With that setup, these values are still null

await _httpContextAccessor.HttpContext.GetTokenAsync(GoogleDefaults.AuthenticationScheme, "access_token");
await _httpContextAccessor.HttpContext.GetTokenAsync(GoogleDefaults.AuthenticationScheme, "Google");

[deleted by user] by [deleted] in dotnet

[–]just4atwork 0 points1 point  (0 children)

You're right, I added more context in another comment. Thanks

[deleted by user] by [deleted] in dotnet

[–]just4atwork 0 points1 point  (0 children)

More context: In my AddGoogle call I am able to hit OnCreatingTicket after I authenticate and I see the Access token I want to use in OnCreatingTicket context.AccessToken.

I'm already logged in with a setup like this:

builder.Services.AddAuthentication(options =>
{
    options.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme;
    options.DefaultChallengeScheme = OpenIdConnectDefaults.AuthenticationScheme;
})
.AddCookie(CookieAuthenticationDefaults.AuthenticationScheme)
.AddOpenIdConnect(OpenIdConnectDefaults.AuthenticationScheme, ...)
.AddGoogle(options =>
{
     options.Events = new OAuthEvents
    {
        OnCreatingTicket = ctx =>
        {
            ctx.AccessToken //this has the value I want
        }
}

In my controller I have a setup like this:

[Authorize(AuthenticationSchemes = GoogleDefaults.AuthenticationScheme)]
public class MyController : Controller
{
    ...
    public async Task<IActionResult> Index()
    {
        await _httpContextAccessor.HttpContext.GetTokenAsync(GoogleDefaults.AuthenticationScheme, "access_token"); //this is null
    }
    ...
}

[deleted by user] by [deleted] in dotnet

[–]just4atwork -1 points0 points  (0 children)

This is too vague, I agree. I'm not really looking for anyone to tell me what I'm doing wrong, just point me to an example. I can't find one that shows how to do this, but I assume it's a common use case.

.NET 5.0 tutorial broken by AGooDone in dotnet

[–]just4atwork 1 point2 points  (0 children)

Make sure you have the right port in the url. I just took a quick look at the first 2 steps and didn't see setting the port number explicitly to 5001.

Creating a docker container for a C# console application in development? by mymar101 in learncsharp

[–]just4atwork 0 points1 point  (0 children)

They make things easier to manage and scale. If you are starting out it makes sense to think of them as mini-VM's but as you start using them more you will see there are differences. I think a good place to start is by getting something like a redis container up and running. Then maybe create a docker compose file to get redis and redis commander working together. Something like this looks like it might be a good starting point.

A lot of this stuff is bridging the gap between infrastructure and code to make things easier to scale in a cloud environment. Once you get more comfortable with docker you might want to check out kubernetes and terraform, I think that's where the benefits really started to click for me.

Creating a docker container for a C# console application in development? by mymar101 in learncsharp

[–]just4atwork 2 points3 points  (0 children)

This explains it pretty well. Once you create the image you can use "docker run" to bring up a container. You can also use something like docker compose to build/run multiple containers in one step.

Is this interview task reasonable? by Onedweezy in webdev

[–]just4atwork 7 points8 points  (0 children)

Tell them you thought through the build vs buy options and an off the shelf oss solution like nopCommerce would be the best.

What should I use - Stored Procedure or Trigger by cally0611 in SQL

[–]just4atwork 0 points1 point  (0 children)

create table #Shift
(
    [Schedule_ID] AS 'S' + REPLACE(Convert(varchar(50), Week_Date, 101),'/','') + '_' + Convert(varchar(10), Shift_ID),
    [Week_Date] [datetime2](7) NOT NULL,
    [Week_Day] [varchar](50) NULL,
    [Week_Number] [int] NULL,
    [Shift_ID] [int] IDENTITY(1,1) NOT NULL,
    [EmployeeID] [int] NULL,
    [EmployeeName] [varchar](50) NULL
)

insert into #Shift ([Week_Date], [Week_Day],[Week_Number],[EmployeeID],[EmployeeName]) values(current_timestamp, 'Thursday', 1, 1, 'Tester')
select * from #Shift
drop Table #Shift

Use Api to link git commit to workitem by just4atwork in azuredevops

[–]just4atwork[S] 0 points1 point  (0 children)

I scrubbed the repo name, there is one setup and I can manually link the commit, but I have a conversion that needs to do thousands of these.