You can create a unique "Group" each time a user initiates a chat with another user (or set of users). Then when you send messages to that group only those users would receive the message. You could also layer more security in front of sending messages
to a group to ensure that the person sending the message is allowed to send a message to that group.
-----------------
Please remember to click "Mark as Answer" the responsES that resolved your issue.
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
store them same way you store any other data, create an EF context if you dont have one already, create an entity "Message" to store the messages and save them as any other entity:
db.Messages.Add(msg);
For EF examples create a new project with individual user account authentication and it will contained examples of all the CRUD(create, read, update, delete) operations you will need.
-----------------
Please remember to click "Mark as Answer" the responsES that resolved your issue.
None
0 Points
13 Posts
one to one private chat in signalr core
Aug 02, 2017 07:27 PM|Altaf11221|LINK
Hi i want to build a private chat in which a user can chat privatelty to to other users and also i want
to store chat history in database using entity framework core
Participant
1380 Points
608 Posts
Re: one to one private chat in signalr core
Aug 02, 2017 10:59 PM|JBetancourt|LINK
You can create a unique "Group" each time a user initiates a chat with another user (or set of users). Then when you send messages to that group only those users would receive the message. You could also layer more security in front of sending messages to a group to ensure that the person sending the message is allowed to send a message to that group.
Please remember to click "Mark as Answer" the responsES that resolved your issue.
Contributor
6730 Points
2715 Posts
Re: one to one private chat in signalr core
Aug 03, 2017 04:08 AM|Eric Du|LINK
Hi Altaf11221,
According to your description and needs, I think you could use signalr groups, I found some tutorials about how to use it and save data in EF Core:
One to one chat using Asp.net SignalR groups:
http://www.bluelemoncode.com/post/2013/02/17/One-to-one-chat-using-Aspnet-SignalR-groups.aspx
Building A Private Chat Application Using SignalR:
http://www.c-sharpcorner.com/article/building-a-private-chat-application-using-signalr/
SignalR Scaleout with SQL Server:
https://docs.microsoft.com/en-us/aspnet/signalr/overview/performance/scaleout-with-sql-server
EF Core Save Data:
https://docs.microsoft.com/en-us/ef/core/saving/basic
Best Regards,
Eric Du
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
Participant
1380 Points
608 Posts
Re: one to one private chat in signalr core
Aug 05, 2017 02:47 PM|JBetancourt|LINK
did you resolved your issue?
Please remember to click "Mark as Answer" the responsES that resolved your issue.
None
0 Points
13 Posts
Re: one to one private chat in signalr core
Aug 07, 2017 02:22 PM|Altaf11221|LINK
i want to store messages into db using EF
Participant
1380 Points
608 Posts
Re: one to one private chat in signalr core
Aug 07, 2017 05:57 PM|JBetancourt|LINK
store them same way you store any other data, create an EF context if you dont have one already, create an entity "Message" to store the messages and save them as any other entity:
db.Messages.Add(msg);
For EF examples create a new project with individual user account authentication and it will contained examples of all the CRUD(create, read, update, delete) operations you will need.
Please remember to click "Mark as Answer" the responsES that resolved your issue.