Exemplo n.º 1
0
		public static IEnumerable<Producto> GetAllProductos()
		{
			using (var ctx = new DemoCSLAContainer())
			{
				return ctx.ProductoSet.ToList();
			}
		}
Exemplo n.º 2
0
 public static IEnumerable <Cliente> GetAllClientes()
 {
     using (var ctx = new DemoCSLAContainer())
     {
         return(ctx.ClienteSet.ToList());
     }
 }
Exemplo n.º 3
0
 public static IEnumerable <Producto> GetAllProductos()
 {
     using (var ctx = new DemoCSLAContainer())
     {
         return(ctx.ProductoSet.ToList());
     }
 }
Exemplo n.º 4
0
		public static IEnumerable<Cliente> GetAllClientes()
		{

			using (var ctx = new DemoCSLAContainer())
			{
				return ctx.ClienteSet.ToList();
			}

		}
Exemplo n.º 5
0
		public static Cliente GetClienteByID(int ID)
		{
			using (var ctx = new DemoCSLAContainer())
			{
				var customer = ctx.ClienteSet.SingleOrDefault(c => c.ID == ID);

				if (customer != null)
					return customer;

				throw new InvalidOperationException("No se encuentra el Cliente con el ID especificado");
			}
		}
Exemplo n.º 6
0
		public static Producto GetProductoById(int id)
		{
			using (var ctx = new DemoCSLAContainer())
			{
				var product = ctx.ProductoSet.SingleOrDefault(p => p.ID == id);

				if (product != null)
				{
					return product;
				}

				throw new InvalidOperationException("No se encuentra el Producto con el ID especificado");
			}
		}
Exemplo n.º 7
0
        public static Cliente GetClienteByID(int ID)
        {
            using (var ctx = new DemoCSLAContainer())
            {
                var customer = ctx.ClienteSet.SingleOrDefault(c => c.ID == ID);

                if (customer != null)
                {
                    return(customer);
                }

                throw new InvalidOperationException("No se encuentra el Cliente con el ID especificado");
            }
        }
Exemplo n.º 8
0
        public static Producto GetProductoById(int id)
        {
            using (var ctx = new DemoCSLAContainer())
            {
                var product = ctx.ProductoSet.SingleOrDefault(p => p.ID == id);

                if (product != null)
                {
                    return(product);
                }

                throw new InvalidOperationException("No se encuentra el Producto con el ID especificado");
            }
        }