@@ -39,7 +39,7 @@ The next example defines that each car requires an engine, while an engine is op
3939public sealed class Car : Identifiable <long >
4040{
4141 [HasOne ]
42- public Engine Engine { get ; set ; } = null ! ;
42+ public required Engine Engine { get ; set ; }
4343}
4444
4545public sealed class Engine : Identifiable <long >
@@ -264,7 +264,7 @@ There are two ways the exposed relationship name is determined:
264264public class TodoItem : Identifiable <long >
265265{
266266 [HasOne (PublicName = " item-owner" )]
267- public Person Owner { get ; set ; } = null ! ;
267+ public required Person Owner { get ; set ; }
268268}
269269```
270270
@@ -297,7 +297,7 @@ Otherwise, the relationship (and its related resources, when included) are silen
297297public class User : Identifiable <long >
298298{
299299 [HasOne (Capabilities = ~ HasOneCapabilities .AllowView )]
300- public LoginAccount Account { get ; set ; } = null ! ;
300+ public required LoginAccount Account { get ; set ; }
301301}
302302```
303303
@@ -339,7 +339,7 @@ Indicates whether POST and PATCH requests can replace the relationship. When sen
339339public class User : Identifiable <long >
340340{
341341 [HasOne (Capabilities = ~ HasOneCapabilities .AllowSet )]
342- public LoginAccount Account { get ; set ; } = null ! ;
342+ public required LoginAccount Account { get ; set ; }
343343}
344344```
345345
@@ -400,7 +400,7 @@ So for the calculated property to be evaluated correctly, the related entity mus
400400public class ShippingAddress : Identifiable <long >
401401{
402402 [Attr ]
403- public string Street { get ; set ; } = null ! ;
403+ public required string Street { get ; set ; }
404404
405405 [Attr ]
406406 public string ? CountryName => Country ? .DisplayName ;
@@ -412,7 +412,7 @@ public class ShippingAddress : Identifiable<long>
412412
413413public class Country
414414{
415- public string IsoCode { get ; set ; } = null ! ;
416- public string DisplayName { get ; set ; } = null ! ;
415+ public required string IsoCode { get ; set ; }
416+ public required string DisplayName { get ; set ; }
417417}
418418```
0 commit comments