File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ author: jamesnk
44description : Learn how to create Protobuf messages for .NET apps.
55monikerRange : ' >= aspnetcore-3.0'
66ms.author : wpickett
7- ms.date : 02/12/2021
7+ ms.date : 04/07/2026
88uid : grpc/protobuf
99---
1010# Create Protobuf messages for .NET apps
@@ -107,12 +107,12 @@ The generated properties in the C# class aren't the .NET date and time types. Th
107107// Create Timestamp and Duration from .NET DateTimeOffset and TimeSpan.
108108var meeting = new Meeting
109109{
110- Time = Timestamp .FromDateTimeOffset (meetingTime ), // also FromDateTime()
110+ Start = Timestamp .FromDateTimeOffset (meetingTime ), // also FromDateTime()
111111 Duration = Duration .FromTimeSpan (meetingLength )
112112};
113113
114114// Convert Timestamp and Duration to .NET DateTimeOffset and TimeSpan.
115- var time = meeting .Time .ToDateTimeOffset ();
115+ var time = meeting .Start .ToDateTimeOffset ();
116116var duration = meeting .Duration ? .ToTimeSpan ();
117117```
118118
You can’t perform that action at this time.
0 commit comments