internal static ServiceOffering From(XElement serviceOfferingElement) { var offering = new ServiceOffering { Id = int.Parse(serviceOfferingElement.ExtractValue("id")), CPUNumber = int.Parse(serviceOfferingElement.ExtractValue("cpuNumber")), CPUSpeed = int.Parse(serviceOfferingElement.ExtractValue("cpuSpeed")), Created = string.IsNullOrWhiteSpace(serviceOfferingElement.ExtractValue("created")) ? DateTime.MinValue : DateTime.Parse(serviceOfferingElement.ExtractValue("created")), DisplayText = serviceOfferingElement.ExtractValue("displayText"), Domain = serviceOfferingElement.ExtractValue("domain"), DomainId = string.IsNullOrWhiteSpace(serviceOfferingElement.ExtractValue("domainId")) ? 0 : int.Parse(serviceOfferingElement.ExtractValue("domainId")), Memory = int.Parse(serviceOfferingElement.ExtractValue("memory")), Name = serviceOfferingElement.ExtractValue("name"), OffersHighAvailability = bool.Parse(serviceOfferingElement.ExtractValue("offerha")), StorageType = serviceOfferingElement.ExtractValue("storageType"), }; return(offering); }
internal static ServiceOffering From(XElement serviceOfferingElement) { var offering = new ServiceOffering { Id = int.Parse(serviceOfferingElement.ExtractValue("id")), CPUNumber = int.Parse(serviceOfferingElement.ExtractValue("cpuNumber")), CPUSpeed = int.Parse(serviceOfferingElement.ExtractValue("cpuSpeed")), Created = string.IsNullOrWhiteSpace(serviceOfferingElement.ExtractValue("created")) ? DateTime.MinValue : DateTime.Parse(serviceOfferingElement.ExtractValue("created")), DisplayText = serviceOfferingElement.ExtractValue("displayText"), Domain = serviceOfferingElement.ExtractValue("domain"), DomainId = string.IsNullOrWhiteSpace(serviceOfferingElement.ExtractValue("domainId")) ? 0 : int.Parse(serviceOfferingElement.ExtractValue("domainId")), Memory = int.Parse(serviceOfferingElement.ExtractValue("memory")), Name = serviceOfferingElement.ExtractValue("name"), OffersHighAvailability = bool.Parse(serviceOfferingElement.ExtractValue("offerha")), StorageType = serviceOfferingElement.ExtractValue("storageType"), }; return offering; }