Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Proveedor
- {
- public int ProveedorId { get; set; }
- public string RazonSocial { get; set; }
- public string DocumentoIdentidad { get; set; }
- public string Direccion { get; set; }
- public string Fijo { get; set; }
- public string Celular { get; set; }
- public string Representante { get; set; }
- public string Email { get; set; }
- public virtual ICollection<Producto> Productos { get; set; }
- public virtual ICollection<Marca> Marcas { get; set; }
- }
- public class ProveedorExtend
- {
- public int Id { get; set; }
- public string Descripcion { get; set; }
- }
- public IEnumerable<ProveedorExtend> SelectList(int? codigo, string nombre)
- {
- var result = (from p in Context.Proveedores
- select new ProveedorExtend()
- {
- Id = p.ProveedorId,
- Descripcion = p.RazonSocial
- })
- where ((!codigo.HasValue) || (p.Codigo.Contains(codigo.Value)))
- && ((nombre == null) || (p.Nombre.Contains(nombre)))
- select p).ToList();;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement