public static bool Create(User user) { bool result = false; using (var conn = new RRSOFT()) { try { var search = Search(user.UserId); if (search == null) { conn.User.Add(user); } else { conn.Entry(user).State = EntityState.Modified; } conn.SaveChanges(); result = true; } catch (Exception) { throw; } return(result); } }
public static bool Delete(User exist) { bool result = false; using (var conn = new RRSOFT()) { try { conn.Entry(exist).State = EntityState.Deleted; conn.SaveChanges(); result = true; } catch (Exception) { throw; } } return(result); }