Emc.SewPlus.Nems.Models 1.12.0

dotnet add package Emc.SewPlus.Nems.Models --version 1.12.0
                    
NuGet\Install-Package Emc.SewPlus.Nems.Models -Version 1.12.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Emc.SewPlus.Nems.Models" Version="1.12.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Emc.SewPlus.Nems.Models" Version="1.12.0" />
                    
Directory.Packages.props
<PackageReference Include="Emc.SewPlus.Nems.Models" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Emc.SewPlus.Nems.Models --version 1.12.0
                    
#r "nuget: Emc.SewPlus.Nems.Models, 1.12.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Emc.SewPlus.Nems.Models@1.12.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Emc.SewPlus.Nems.Models&version=1.12.0
                    
Install as a Cake Addin
#tool nuget:?package=Emc.SewPlus.Nems.Models&version=1.12.0
                    
Install as a Cake Tool

EMC NEMS Data Services Model Definitions

Model definitions for data services provided by the National Electricity Market of Singapore (NEMS) system of the Energy Market Company (EMC) of Singapore.

Definitions are based on the Data Services Specification for NEMS System document.

📦 Installation

Install the package via the NuGet Package Manager Console, the Nuget Package Manager UI, the .NET CLI or by adding a package reference.

.NET CLI

dotnet add package Emc.SewPlus.Nems.Models.x.x.x.nupkg

Package Manager

Install-Package Emc.SewPlus.Nems.Models.x.x.x.nupkg

🛠️ Usage

All classes representing data elements in the EMC Data Services are marked as Serializable, thereby allowing themselves to participate in XML serialisation and deserialisation.

Deserialising XML Data Received From an EMC Web Service

Suppose the following real time price data is returned (as a XML string) and saved in a file RTP.xml:

<?xml version="1.0" encoding="UTF-8"?>
<list>
    <RealTimePrice>
        <period>25</period>
        <reportType>REP</reportType>
        <tradingDate>31-Jul-2022</tradingDate>
        <demand>6101.455</demand>
        <tcl>0.000</tcl>
        <USEP>183.08</USEP>
        <lcp>0.00</lcp>
        <regulation>28.15</regulation>
        <primaryReserve>1</primaryReserve>
        <secondaryReserve/>
        <contingencyReserve>20.16</contingencyReserve>
        <eheur>-0.76</eheur>
        <solar>22.540</solar>
        <RUSEP>659.52</RUSEP>
        <MAP>236.65</MAP>
        <MAPT>591.75.00</MAPT>
        <tpcApplied>N</tpcApplied>
        <referenceRegulation>22.22</referenceRegulation>
        <referencePrimaryReserve>69.69</referencePrimaryReserve>
        <referenceContingencyReserve>50.44</referenceContingencyReserve>
    </RealTimePrice>
    <RealTimePrice>
        <period>26</period>
        <reportType>REP</reportType>
        <tradingDate>31-Jul-2022</tradingDate>
        <demand>6069.125</demand>
        <tcl>0.000</tcl>
        <USEP>160.15</USEP>
        <lcp>0.00</lcp>
        <regulation>10</regulation>
        <primaryReserve>.14</primaryReserve>
        <secondaryReserve/>
        <contingencyReserve>2</contingencyReserve>
        <eheur>-0.66</eheur>
        <solar>22.540</solar>
        <RUSEP>659.52</RUSEP>
        <MAP>236.65</MAP>
        <MAPT>591.75.00</MAPT>
        <tpcApplied>N</tpcApplied>
        <referenceRegulation>22.22</referenceRegulation>
        <referencePrimaryReserve>69.69</referencePrimaryReserve>
        <referenceContingencyReserve>50.44</referenceContingencyReserve>
    </RealTimePrice>
</list>

To deserialise the XML data into a RealTimePrice object:


using Emc.SewPlus.Nems.Models.Reports.Cwr;
using System.Xml;
using System.Xml.Serialization;

public List<RealTimePrice> DeserializeRealTimePriceXml(string xmlFile)
{
    XmlSerializer serializer = new XmlSerializer(typeof(List<RealTimePrice>), new XmlRootAttribute("list"));
    using (FileStream fileStream = new FileStream(xmlFile, FileMode.Open, FileAccess.Read))
    {
        using (XmlReader xmlReader = XmlReader.Create(fileStream))
        {
            var results = serializer.Deserialize(xmlReader) as List<RealTimePrice>;
            return results;
        }
    }
}

To deserialise the same data into the same object using the child elements:


using Emc.SewPlus.Nems.Models.Reports.Cwr;
using System.Linq;
using System.Xml.Linq;

public List<RealTimePrice> DeserializeRealTimePriceXml(string xmlFile)
{
    XDocument doc = XDocument.Load(xmlFile);
    var results = doc.Element("list").Elements("RealTimePrice")
        .Select(n => new RealTimePrice()
        {
            Period = byte.Parse(n.Element("period").Value),
            ReportType = n.Element("reportType").Value,
            TradingDateString = n.Element("tradingDate").Value,
            Demand = decimal.Parse(n.Element("demand").Value),
            TotalCurtailedLoad = decimal.Parse(n.Element("tcl").Value),
            Usep = decimal.Parse(n.Element("USEP").Value),
            LoadCurtailmentPrice = decimal.Parse(n.Element("lcp").Value),
            RegulationPrice = decimal.Parse(n.Element("regulation").Value),
            PrimaryReservePrice = decimal.Parse(n.Element("primaryReserve").Value),
			
            // property is nullable (defined as nillable in XSD)
            SecondaryReservePrice = (n.Element("secondaryReserve").Value == null)? null : n.Element("secondaryReserve").Value,
						
            ContingencyReservePrice = n.Element("contingencyReserve").Value,
            Eheur = decimal.Parse(n.Element("eheur").Value),
            SolarGenerationForecast = decimal.Parse(n.Element("solar").Value),
            ReferenceUniformSingaporeEnergyPrice = decimal.Parse(n.Element("RUSEP").Value),
            MovingAveragePrice = decimal.Parse(n.Element("MAP").Value),
            MovingAveragePriceThreshold = decimal.Parse(n.Element("MAPT").Value),
            TpcApplied = n.Element("tpcApplied").Value.Equals("Y") ? YesNoResponse.Yes
                : (n.Element("tpcApplied").Value.Equals("N") ? YesNoResponse.No : YesNoResponse.NotDefined),
            ReferenceRegulation = decimal.Parse(n.Element("referenceRegulation").Value),
            ReferencePrimaryReserve = decimal.Parse(n.Element("referencePrimaryReserve").Value),
            ReferenceContingencyReserve = decimal.Parse(n.Element("referenceContingencyReserve").Value)
        }).ToList();

    return results;
}

EMC Download Reports Category Classes

This package also offers a set of classes under the Emc.SewPlus.Nems.Models.Reports namespace that simplifies the deserialisation of XML data without having to specify the exact report class. Their names end with Reports:

  • Emc.SewPlus.Nems.Models.Reports.Cwr.CorporateWebsiteReports representing the set of Corporate Website Reports.
  • Emc.SewPlus.Nems.Models.Reports.Mcr.MarketClearingRunReports representing the set of Market Clearing Run Reports.
  • Emc.SewPlus.Nems.Models.Reports.Stl.SettlementReports representing the set of Settlement Reports.
  • Emc.SewPlus.Nems.Models.Reports.Tsr.TradeSummaryReports representing the set of Trade Summary Reports.
  • Emc.SewPlus.Nems.Models.Reports.Opr.OtherPublishedReports representing the set of Other Published Reports.

Using the same file RTP.xml, its contents can be deserialised using the CorporateWebsiteReports class since the corresponding Real Time Price report comes under the set of Corporate Website reports:


using Emc.SewPlus.Nems.Models.Reports.Cwr;
using System.Xml;
using System.Xml.Serialization;

public List<RealTimePrice> DeserializeRealTimePriceXml(string xmlFile)
{
    // use the CorporateWebsiteReports class to deserialise the XML data instead of the RealTimePrice class
    XmlSerializer serializer = new XmlSerializer(typeof(CorporateWebsiteReports));
    using (FileStream fileStream = new FileStream(xmlFile, FileMode.Open, FileAccess.Read))
    {
        using (XmlReader xmlReader = XmlReader.Create(fileStream))
        {
            var results = serializer.Deserialize(xmlReader) as CorporateWebsiteReports;
            return results.Items.Cast<Emc.SewPlus.Nems.Models.Reports.Cwr.RealTimePrice>().ToList();
        }
    }
}

Serialising XML Data for an EMC Web Service

To serialise an object of a class e.g. BidSubmission into XML to submit to EMC web services:


using Emc.SewPlus.Nems.Models.Submissions.Bids;
using System.Xml;
using System.Xml.Serialization;

public string SerializeBidSubmissionToXml(BidSubmission bidSubmission)
{
    XmlSerializer serializer = new XmlSerializer(typeof(BidSubmission));
    using (StringWriter writer = new StringWriter())
    {
        serializer.Serialize(writer, bidSubmission);
        return writer.ToString();
    }
}

🚀 Target Frameworks

  • .NET: Core 3.0, Core 3.1, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0
  • .NET Framework: 4.0, 4.5, 4.5.2, 4.6.1, 4.6.2, 4.7.2, 4.8, 4.8.1
  • .NET Standard: 2.0, 2.1

👨‍💻 Author and Contact

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 is compatible.  netcoreapp3.1 is compatible. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net40 is compatible.  net403 was computed.  net45 is compatible.  net451 was computed.  net452 is compatible.  net46 was computed.  net461 is compatible.  net462 is compatible.  net463 was computed.  net47 was computed.  net471 was computed.  net472 is compatible.  net48 is compatible.  net481 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETCoreApp 3.0

    • No dependencies.
  • .NETCoreApp 3.1

    • No dependencies.
  • .NETFramework 4.0

    • No dependencies.
  • .NETFramework 4.5

    • No dependencies.
  • .NETFramework 4.5.2

    • No dependencies.
  • .NETFramework 4.6.1

    • No dependencies.
  • .NETFramework 4.6.2

    • No dependencies.
  • .NETFramework 4.7.2

    • No dependencies.
  • .NETFramework 4.8

    • No dependencies.
  • .NETFramework 4.8.1

    • No dependencies.
  • .NETStandard 2.0

    • No dependencies.
  • .NETStandard 2.1

    • No dependencies.
  • net10.0

    • No dependencies.
  • net5.0

    • No dependencies.
  • net6.0

    • No dependencies.
  • net7.0

    • No dependencies.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.12.0 97 9/2/2026
1.11.0 101 8/31/2026
1.10.0 121 8/3/2026
1.9.0 111 7/29/2026
1.8.0 117 7/27/2026
1.7.0 123 7/24/2026
1.6.0 119 7/22/2026
1.5.1 124 7/20/2026
1.5.0 110 7/18/2026

Changes in v1.12.0 (2026-09-02):
 - [Added] "RiskExposureReport" class under the "Emc.SewPlus.Nems.Models.Reports.Opr" namespace.