Esempio n. 1
0
            public AggregateRoot <Flight> Deserialize(JsonSerializerSettings jsonSerializerSettings)
            {
                var flight = JsonConvert.DeserializeObject <Flight>(JsonDocument, jsonSerializerSettings)
                             ?? throw new DataException($"JsonDocument is null.");
                var versionTag = VersionTagConverter.FromBytes(VersionTag);

                return(AggregateRoot.Create(flight, versionTag));
            }
Esempio n. 2
0
            public FlightDetails Deserialize(JsonSerializerSettings jsonSerializerSettings)
            {
                var versionTag = VersionTagConverter.FromBytes(VersionTag);
                var bookings   = JsonConvert.DeserializeObject <IEnumerable <Booking> >(Bookings, jsonSerializerSettings)
                                 ?? throw new DataException($"JsonDocument is null.");

                return(new FlightDetails(
                           new FlightId(Id),
                           versionTag,
                           Capacity,
                           bookings));
            }