We will now define a couple of message classes that we will use to send chat messages. We will create a base message class that will contain information that is shared between all types of messages. We will also create a separate project for the messages, which will be a .NET Standard library. The reason that we will create it as a separate .NET Standard library is that we can then reuse it in the app we will build in the next chapter. Proceed as follows:
- Create a new .NET Standard 2.1 project and name it Chat.Messages.
- Add a reference to Chat.Messages in the Chat.Functions project.
- Create a new class in the Chat.Messages project and name it Message.
- Add a TypeInfo property to the Message class. We will need this property later in Chapter 9, Building a Real-Time Chat Application when we will carry out serialization of the messages.
- Add a property for Id, of the string type.
- Add a property for Timestamp, of the DateTime type.
- Add...