Skip to content

Latest commit

 

History

History

ChatDataSources

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Chat Data Source Demos

EntityFramework (Sqlite and SqlServer)

chat

![!IMPORTANT] Notice we are using the CollectionChanged event of the Itemssource to save the messages to the database.

private void Items_CollectionChanged(object? sender, NotifyCollectionChangedEventArgs e)
{
    if (e.NewItems?.Count > 0)
    {
        foreach (var item in e.NewItems)
        {
            if (item is SimpleChatItem chatItem)
            {
                dbContext.Messages.Add(chatItem);
            }
        }

        // After adding all the items to the dbContext, we save the database
        dbContext.SaveChanges();
    }
}

gRPC

TODO

signalR

TODO