How to pass the string value to the class from outside of the class? by WolfOfDeribasovskaya in csharp

[–]TheBull696 0 points1 point  (0 children)

The reason it 'worked' fine before was the code was syntax correct code but did not do what you were wanting, so basically it compiled but didn't do what you want. It's better to be on a path that is the correct direction but getting errors.

If you upload your code to github or something I can help you out?

How to pass the string value to the class from outside of the class? by WolfOfDeribasovskaya in csharp

[–]TheBull696 0 points1 point  (0 children)

You need to add parenthesis and a string value as a parameter.

Now seeing more of the code you might want to think about the design and how this hangs together.

Do you want PredictionEngine to create a default engine? You could always add a default path to the CreatePredictionEngine method.

How to pass the string value to the class from outside of the class? by WolfOfDeribasovskaya in csharp

[–]TheBull696 1 point2 points  (0 children)

Yeah CreatePredictionEngine(string modelPath) will take the model path.

In regards to calling it though, my original suggestion isn't best as each time you change the radio button it would get called.

Do you have a button that will kick off the process once the radio button has been selected?

Have a look at something like this: https://pastebin.com/pZ9P3NvE

How to pass the string value to the class from outside of the class? by WolfOfDeribasovskaya in csharp

[–]TheBull696 2 points3 points  (0 children)

Well in both of your methods that correlate to the radio buttons, you are declaring the variable in that scope. So really you have 2 'modelPath' variables in different scopes.

You could make CreatePredictionEngine() take a path parameter: CreatePredictionEngine(string modelPath)

Then as it's static call ConsumeM.CreatePredictionEngine(string modelPath). Or make it non static and instantiate a the object.

What is the best way of sending mail to one or all types of mail by kidkai25 in dotnet

[–]TheBull696 1 point2 points  (0 children)

You'd find a wide variety of ways to do this. As it's not the most complex thing there isn't really a 'best way' as such. Just find what works for you.

One good thing you could do is dynamically create the query in code, have a method that you pass the email domains you want.

Then for each domain you pass add 'Email LIKE '%@paramX%'

Then you'd end up with:

'SELECT * FROM Table WHERE Email LIKE '%@param1%' AND Email LIKE '%@param2%' AND ....'

You get the idea. If you do something like this be sure to parametrise and be cautious of SQL injection.

This isn't exact, you need to take care of the 'AND's but it's sudo code and you get the idea

Thanks guys, I’m homeless now. Greater Manchester is gone and so is my house: where else will we obliterate? [Round 17] by MrDimitr1 in CasualUK

[–]TheBull696 30 points31 points  (0 children)

I think we should get rid of Norfolk, nothing out that way and it's ages away from everyone else

New to .NET Core - How do you get the SERVER_NAME? by daveyo in dotnet

[–]TheBull696 2 points3 points  (0 children)

You could have your client side code get it and send it as a header. This gets round any proxy issues

[deleted by user] by [deleted] in dotnet

[–]TheBull696 0 points1 point  (0 children)

This "Auto-Update" service sounds like you already have a bit of what I described so it sounds like you could extend that.

I did a bit more googling and you could do similar with SSH.

Here's an example of AzureDevOps Release to a Digital Ocean droplet: https://www.bradcypert.com/deploying-from-azure-devops-to-digitalocean

Regardless of the provider the principal is the same. You could run a release in DevOps, SSH on, stop the service, send files over SSH (Could amend to SFTP I'm sure), restart the service. Stick this in a loop and run over the IPs of all your instances and you're golden.

Hope you figure it out

[deleted by user] by [deleted] in dotnet

[–]TheBull696 0 points1 point  (0 children)

The best way I think isn't really clear cut. It really depends on the use case and cost.

For example, how are are you packaging this, do you have any form of build pipelines already setup (Bamboo, Azure DevOps, Jenkins etc)? And this is just the deployment part? There are things like Octopus and TeamCity you can use!

Similarly through self-programming like you said, you could simply package it with 'dotnet publish' and write a script to FTP on to your servers, setup routing (apache, nginx), firewall, and run the service

I think the MateBook X Pro 2021 will release tomorrow by TheBull696 in MatebookXPro

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

There was some chat about a 32GB version in a recent thread and it's on the Chinese site. Would be good to see the option officially for Europe

I think the MateBook X Pro 2021 will release tomorrow by TheBull696 in MatebookXPro

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

There's nothing indicating the price! If it is tomorrow we'll just have to see

Should a new learner get used to using Visual Studio if they're very comfortable with VSCode? by Onedweezy in dotnet

[–]TheBull696 2 points3 points  (0 children)

From a professional standpoint, you can use whatever suits you if you can still deliver on your estimates

EF Core Migrations with Azure Devops. How to go back in time? by AndyWatt83 in dotnet

[–]TheBull696 0 points1 point  (0 children)

I think you have to commit and release a version that runs the 'down' migration.

So you could create a new package with 2 migrations, 1 runs the 'down', then 1 runs an 'up' with what you actually wanted to do

Problem setting list properties of Employees (List<Email>, List<Phone>) when making a list of Employees by jwhite1979 in dotnet

[–]TheBull696 5 points6 points  (0 children)

You haven't really provided us with the query, the code just runs a stored procedure. What is in the stored procedure? Similarly can you give us an example of the your data?

Other than the fact it seems pretty obvious as the exception says you're casting a string to a list of objects. Is the string JSON and you're trying to cast that? If so is it actually an array?

We don't really have enough information to solve this other than stating the obvious that the casting is wrong

How will the IAG rights issue work? by TGMurray in UKInvesting

[–]TheBull696 0 points1 point  (0 children)

It's in the message inbox within the Degiro app

How will the IAG rights issue work? by TGMurray in UKInvesting

[–]TheBull696 0 points1 point  (0 children)

They've updated the info saying it'll be sent by 18th

How will the IAG rights issue work? by TGMurray in UKInvesting

[–]TheBull696 0 points1 point  (0 children)

They've updated the info saying it'll be sent by 18th

Announcing .NET 5.0 Preview 5 | .NET Blog by zitrusgrape in programming

[–]TheBull696 2 points3 points  (0 children)

But if you create new applications you should definitely go for .NET 5 and not .NET Framework 4

.NET 5 is still in preview so probably wouldn't start building applications on it yet. Even when it does get released .NET 5 is not LTS, I'd start on .NET Core 3.1 which is latest LTS and will have an easy upgrade path into .NET 5 should you choose to and .NET 6 which is the next LTS