public List <Service> GetServices() { using (var context = new WooContext()) { return(context.Services.ToList()); } }
public List <User> GetUsers() { using (var context = new WooContext()) { return(context.Users.ToList()); } }
public Service GetService(int id) { using (var context = new WooContext()) { return(context.Services.ToList().Find(i => i.ID == id)); } }
public Product GetProduct(int id) { using (var context = new WooContext()) { return(context.Products.ToList().Find(i => i.ID == id)); } }
public List <Product> GetProducts() { using (var context = new WooContext()) { return(context.Products.ToList()); } }
public User AuthenticateUser(string userName, string password) { using (var context = new WooContext()) { return(context.Users.ToList().Find(i => i.UserName == userName && i.Password == password)); } }
public bool IsUserExist(User user) { using (var context = new WooContext()) { var users = context.Users.Where(i => i.UserName == user.UserName || i.Email == user.Email); return(users.Any()); } }
public Contact AddContact(Contact contact) { using (var context = new WooContext()) { context.Contacts.Add(contact); context.SaveChanges(); return(contact); } }
public User AddUser(User user) { using (var context = new WooContext()) { context.Users.Add(user); context.SaveChanges(); return(user); } }