Click here to Skip to main content
15,867,308 members
Home / Discussions / C#
   

C#

 
AnswerRe: Async - await PinPopular
Richard Deeming20-Sep-22 5:06
mveRichard Deeming20-Sep-22 5:06 
GeneralRe: Async - await Pin
MarkTJohnson20-Sep-22 5:47
professionalMarkTJohnson20-Sep-22 5:47 
GeneralRe: Async - await Pin
dataminers21-Sep-22 0:04
dataminers21-Sep-22 0:04 
GeneralRe: Async - await Pin
Richard Deeming21-Sep-22 2:07
mveRichard Deeming21-Sep-22 2:07 
GeneralRe: Async - await Pin
dataminers21-Sep-22 5:33
dataminers21-Sep-22 5:33 
QuestionHow to make a license key system with Realtime DB? Pin
Moses Man19-Sep-22 0:11
Moses Man19-Sep-22 0:11 
AnswerRe: How to make a license key system with Realtime DB? Pin
OriginalGriff19-Sep-22 2:21
mveOriginalGriff19-Sep-22 2:21 
QuestionHow to create a many-to-many relationship between users in a table? Pin
Alex Wright 202216-Sep-22 6:16
Alex Wright 202216-Sep-22 6:16 
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; }

    //Navigation property
    public Department Department { get; set; }
}


My desired table is:

C#
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?
AnswerRe: How to create a many-to-many relationship between users in a table? Pin
Gerry Schmitz16-Sep-22 6:30
mveGerry Schmitz16-Sep-22 6:30 
GeneralRe: How to create a many-to-many relationship between users in a table? Pin
Alex Wright 202216-Sep-22 6:33
Alex Wright 202216-Sep-22 6:33 
GeneralRe: How to create a many-to-many relationship between users in a table? Pin
Gerry Schmitz16-Sep-22 6:42
mveGerry Schmitz16-Sep-22 6:42 
GeneralRe: How to create a many-to-many relationship between users in a table? Pin
Alex Wright 202216-Sep-22 6:55
Alex Wright 202216-Sep-22 6:55 
GeneralRe: How to create a many-to-many relationship between users in a table? Pin
Eddy Vluggen16-Sep-22 23:59
professionalEddy Vluggen16-Sep-22 23:59 
SuggestionRe: How to create a many-to-many relationship between users in a table? Pin
Richard Deeming19-Sep-22 21:16
mveRichard Deeming19-Sep-22 21:16 
QuestionProgram instalator in C#, Visual Studio Pin
Ismael_199912-Sep-22 5:36
Ismael_199912-Sep-22 5:36 
AnswerRe: Program instalator in C#, Visual Studio Pin
Gerry Schmitz12-Sep-22 6:21
mveGerry Schmitz12-Sep-22 6:21 
AnswerRe: Program instalator in C#, Visual Studio Pin
OG MAYOR MRL25-Sep-22 2:48
OG MAYOR MRL25-Sep-22 2:48 
Questionreading memory stream in byte chunks Pin
mjeeves10-Sep-22 8:41
mjeeves10-Sep-22 8:41 
GeneralRe: reading memory stream in byte chunks Pin
harold aptroot10-Sep-22 9:49
harold aptroot10-Sep-22 9:49 
GeneralRe: reading memory stream in byte chunks Pin
mjeeves10-Sep-22 10:04
mjeeves10-Sep-22 10:04 
GeneralRe: reading memory stream in byte chunks Pin
harold aptroot10-Sep-22 10:15
harold aptroot10-Sep-22 10:15 
QuestionC# Service: Error 1053: The service did not respond to the start or control request in a timely fashion Pin
temuco8-Sep-22 20:41
professionaltemuco8-Sep-22 20:41 
AnswerRe: C# Service: Error 1053: The service did not respond to the start or control request in a timely fashion Pin
Richard Deeming8-Sep-22 21:49
mveRichard Deeming8-Sep-22 21:49 
GeneralRe: C# Service: Error 1053: The service did not respond to the start or control request in a timely fashion Pin
temuco8-Sep-22 22:34
professionaltemuco8-Sep-22 22:34 
General[Solved] Re: C# Service: Error 1053: The service did not respond to the start or control request in a timely fashion Pin
temuco9-Sep-22 1:38
professionaltemuco9-Sep-22 1:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.