private void ParseNodePrices(XContainer xEle) { var i = 0; var resourceId = _context.HhResources.Single(s => s.ResourceName == xEle.Element(_sdNs + "NodeName").Value) .ResourceID; var hhPdDetail = new HhShadowDetail[24]; foreach ( var ele in xEle.Elements(_sdNs + "HourlyPrices")) { hhPdDetail[i] = new HhShadowDetail { ResourceID = resourceId, ScheHour = Convert.ToInt32(ele.Element(_sdNs + "DeliveryHour").Value), ScheMW = Convert.ToDecimal(ele.Elements(_sdNs + "Prices").First(p => p.Element(_sdNs + "PriceType").Value.Equals("Energy")) .Element(_sdNs + "MCP").Value) }; _hhSdMain.HhShadowDetails.Add(hhPdDetail[i]); i++; } }
private void detach_HhShadowDetails(HhShadowDetail entity) { this.SendPropertyChanging(); entity.HhShadowMain = null; }
partial void DeleteHhShadowDetail(HhShadowDetail instance);
partial void UpdateHhShadowDetail(HhShadowDetail instance);
partial void InsertHhShadowDetail(HhShadowDetail instance);
private void attach_HhShadowDetails(HhShadowDetail entity) { this.SendPropertyChanging(); entity.HhResource = this; }