public static void SaveConversion(Conversion conversion) { using (var context = new ConversionDBContext()) { context.Entry(conversion).State = EntityState.Modified; context.SaveChanges(); } }
public static void AddUser(User user) { using (var context = new ConversionDBContext()) { context.Users.Add(user); context.SaveChanges(); } }
public static void AddConversion(Conversion conversion) { using (var context = new ConversionDBContext()) { conversion.DeleteDatabaseValues(); context.Conversions.Add(conversion); context.SaveChanges(); } }
public static void DeleteConversion(Conversion selectedConversion) { using (var context = new ConversionDBContext()) { selectedConversion.DeleteDatabaseValues(); context.Conversions.Attach(selectedConversion); context.Conversions.Remove(selectedConversion); context.SaveChanges(); } }