public static bool AddMeasure(Measure measure) { using (var context = DatabaseContext.Initialize()) { context.Measures.Add(measure); context.SaveChanges(); } return true; }
public static Measure CreateMeasure(Guid deviceUID, int tariffPartNo, float value, double? moneyValue, DateTime dateTime) { var measure = new Measure(); measure.DeviceUID = deviceUID; measure.TariffPartNo = tariffPartNo; measure.Value = value; measure.MoneyValue = moneyValue; measure.DateTime = dateTime; return measure; }