public Client Post(Client client) { using (var dbCtx = new SiboSupermarketEntities()) { dbCtx.Configuration.ProxyCreationEnabled = false; dbCtx.Client.Add(client); int x = dbCtx.SaveChanges(); return((x > 0) ? client : null); } }
public Adviser GetAdviser(string User, string Pass) { var eAdviser = new Adviser(); using (var dbCtx = new SiboSupermarketEntities()) { dbCtx.Configuration.ProxyCreationEnabled = false; eAdviser = dbCtx.Adviser.FirstOrDefault(x => x.Identification == User && x.Password == Pass); } return(eAdviser); }
public IEnumerable <Client> Get() { var lClients = new List <Client>(); using (var dbCtx = new SiboSupermarketEntities()) { dbCtx.Configuration.ProxyCreationEnabled = false; lClients = dbCtx.Client.ToList(); } return(lClients.AsEnumerable()); }