|
What do you mean with free and not free?
|
|
|
|
|
I guess the "not free" means one must pay some mony for it.
|
|
|
|
|
There aren't any paid api's too.
|
|
|
|
|
Integration for the personal (free) version is not supported, you need to be using the business (not free) verion to be able to extend/integrate its functionality. I recall spending many hours searching for a solution before the bank gave up and forked over the money to MS for the business version.
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
I appreciate your comment but there are still applications manage to track skype personal messages. I'm so curious to find how they do that.
|
|
|
|
|
Hi,
Why Sample #2 is "Bets Practices". Second sample include "await" keyword on the same line with Async Method. Both codes are blocking Thread. Any idea? thanks...
Sample #1
var products = _context.Products.ToList();
Sample #2
var products = await _context.Products.ToListAsync();
|
|
|
|
|
It gets a complicated, but basically the await call spins off a second thread to execute the long running task, and effectively suspends the method until it's complete. But ... the thread that executed await can continue as if the method had finished.
This is handy if you want to run a long task from the main (UI) thread while the UI remains responsive.
For example, if you run this code:
private void MyOtherButton_Click(object sender, EventArgs e)
{
Debug.WriteLine("Before Sleep");
Thread.Sleep(10000);
Debug.WriteLine("After Sleep");
}
Your console will print "Before Sleep", wait ten seconds and print "After Sleep" - but your user can't do anything else with your app in the mean time.
But this code:
private async void MyOtherButton_Click(object sender, EventArgs e)
{
Debug.WriteLine("Before Sleep");
await Task.Run(() => Thread.Sleep(10000));
Debug.WriteLine("After Sleep");
}
Prints the same things, but your user can carry on working - your UI remains working.
Have a look here: https://www.pluralsight.com/guides/understand-control-flow-async-await[^] - it explains it pretty well, and shows examples.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
OriginalGriff wrote: the await call spins off a second thread to execute the long running task
A common misconception.
await is almost nothing to do with multi-threading; it's more about using IO-completion ports to avoid keeping a thread spinning whilst it waits for an external resource to respond.
OriginalGriff wrote:
private async void MyOtherButton_Click(object sender, EventArgs e)
{
Debug.WriteLine("Before Sleep");
await Task.Run(() => Thread.Sleep(10000));
Debug.WriteLine("After Sleep");
} Aside from the fact that you should avoid async void wherever possible[^], spinning up a background thread just to make it sleep seems like a bad idea.
private void MyOtherButton_Click(object sender, EventArgs e)
{
_ = MyOtherButton_Click_Async();
}
private async Task MyOtherButton_Click_Async()
{
Debug.WriteLine("Before Sleep");
await Task.Delay(10000);
Debug.WriteLine("After Sleep");
} See David Fowler's explanation of the _ = SomeTaskReturningMethod(); construct under the "Timer callbacks" heading: AspNetCoreDiagnosticScenarios/AsyncGuidance.md at master · davidfowl/AspNetCoreDiagnosticScenarios · GitHub[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
modified 20-Sep-22 11:11am.
|
|
|
|
|
The second code example doesn't block the thread; it blocks the rest of the method until the call has completed. The low-level thread is freed up to deal with other work until the ToListAsync call completes.
Think of it like a car journey: in the first sample, your kids (the thread) spend the whole time yelling "Are we there yet? Are we there yet? Are we there yet?" until you reach your destination; with the second sample, they get on with reading a book quietly until you tell them you've arrived. One of those scenarios makes for a much nicer journey.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
A beautiful example, thank you for that.
I’ve given up trying to be calm. However, I am open to feeling slightly less agitated.
|
|
|
|
|
I got my answer, thanks.
I have one more question. You said "it blocks the rest of the method" yes the following codes will not be executed until the job is complete, what exactly is waiting here? I guess it was a deep question
|
|
|
|
|
Behind the scenes, your async method will be rewritten into a state machine. Whenever you await something, so long as that operation doesn't complete immediately, the rest of your method will be signed up as a "continuation" to run when that asynchronous operation completes.
As a simple example:
public async Task Foo()
{
Console.WriteLine("Start...");
await Task.Delay(1000);
Console.WriteLine("Done.");
} would (logically) turn into something more like:
public Task Foo()
{
Console.WriteLine("Start...");
return Task.Delay(1000).ContinueWith(_ => Console.WriteLine("Done."));
}
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
|
Hello there!
I am new to this forum and I am also a beginner C# coder. I am trying to make a paid app but I will need to make a license key system. Do anyone know any tutorials I can use for this?
It should check the Realtime DB for the license key and check get the processor ID (or any other unique identifier) then it will check your device for the unique id and boom! you are in.
Or if there are any other tutorials please do link them in the comments below thanks!
|
|
|
|
|
|
I'm working on an ASP.NET Core web API and SQLite database. I have created a table for users of my application. The rule is that each user can send a message to some other users (creating White-List). I use the following model for Users:
public class UserModel
{
[Key]
public int UserID { get; set; }
[Required]
public string Username { get; set; }
[Required]
public string Password { get; set; }
[Required]
public string FirstName { get; set; }
[Required]
public string LastName { get; set; }
[Required]
public string Role { get; set; }
public Department Department { get; set; }
}
My desired table is:
User-SubUser table
------------------------------------
UserID ReceiverUserID
------ --------------
23 11
42 11
19 -
34 23
Note that the IDs mentioned above are the UserIDs from the User table. This table says that users 23 and 42 can send a message to user 11, user 34 can send a message to user 23, and user 19 cannot send message to anyone.
How can I make a model for creating such a table?
|
|
|
|
|
Having "19" in the table is pointless and just complicates the situation.
The simplest "model" is to simply join "Users" and "User-SubUser" when you need to; e.g. who can x send to (join on UserID), or who might x receive from (join on ReceiverUserID).
If you want the (database) server to maintain "referential integrity", that's another story.
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
|
|
|
|
|
Ok, Considering the final table only includes pairs (removing 19), how can I do joining using C# and EF Core?
|
|
|
|
|
Your "vehicle" in this case is LINQ.
Complex Query Operators - EF Core | Microsoft Docs
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
|
|
|
|
|
I meant how I can create a UserSubUser table. I need a C# model to create this table (Code-First approach). UserIDs in the UserSubUser table should be linked to the UserModel table.
|
|
|
|
|
No, they don't. You need to look up normalization, and apply dem rules to your database.
If all that is required is whitelisting, then just have a table with users who are allowed to message each other. You think from C#; but the layer your working in is SQL, where you need to think SQL. Normalize them tables, work from there.
Bastard Programmer from Hell
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
|
I've finished an application in C# using Visual Studio 2022 and need to make an installer for it. I used Microsoft Visual Studio Installer Projects extension and could create the installer which works fine. But I need something else: during instalation, it's necessary to create a folder, then a file and save this file into that folder. But I don't know how to do this in this installer. Does anybody has a solution for this? Thanks.
|
|
|
|
|
Your app should be able to create a folder and file; there's no reason for an installer to do it as you describe it ("the install works fine").
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
|
|
|
|
|
C# you try it's remain a fewer ways for you
|
|
|
|