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