Пример #1
0
        public Customer Put(Customer customer)
        {
            using (SignalrContext context = new SignalrContext())
            {

                var result= context.Custommers.Add(customer);
                context.SaveChanges();
                return result;
            }
        }
Пример #2
0
        public Customer Post(Customer customer)
        {
            using (SignalrContext context = new SignalrContext())
            {

                var result = context.Custommers.Single(p=>p.Id==customer.Id);
                result.Name = customer.Name;
                result.Phone = customer.Phone;
                context.SaveChanges();
                return result;
            }
        }