Esempio n. 1
0
 public static string ToDatabaseValue(this MarketParticipantRole role)
 {
     return(role switch
     {
         MarketParticipantRole.EnergySupplier => EnergySupplierDatabaseValue,
         _ => throw new NotImplementedException(role.ToString()),
     });
Esempio n. 2
0
 public static IQueryable <MarketParticipant> HasRole(
     this IQueryable <MarketParticipant> query,
     MarketParticipantRole role)
 {
     return(query.Where(mp => mp.Role == role.ToDatabaseValue()));
 }