public static bool Upsert(AUVA.Domain.SecurityClothes sc) { try { return(LiteDB.LiteDbUpserts.UpsertSecurityClothes(sc)); } catch (Exception ex) { Console.WriteLine(ex.Message); return(false); } }
public static bool UpsertSecurityClothes(AUVA.Domain.SecurityClothes sc) { if (sc != null) { if (sc.Id < 1) { return(false); } using (var db = AppData.SecurityClothesDB()) { var table = db.SecurityClothesTable(); table.Upsert(sc); return(true); } } else { return(false); } }