Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT
- [Extent1].[Codigo] AS [Codigo],
- [Extent1].[NomeFantasia] AS [NomeFantasia],
- [Extent1].[RazaoSocial] AS [RazaoSocial],
- [Extent1].[IE] AS [IE],
- [Extent1].[CNPJ] AS [CNPJ],
- [Extent1].[Ativo] AS [Ativo],
- [Extent1].[Fornecedor_Codigo] AS [Fornecedor_Codigo]
- FROM [dbo].[Fornecedors] AS [Extent1]
- public partial class Fornecedor
- {
- public Fornecedor()
- {
- this.Entrada = new HashSet<Entrada>();
- this.Produto = new HashSet<Produto>();
- }
- [Key]
- public int Codigo { get; set; }
- [Required(ErrorMessage="Nome fantasia é obrigatório", AllowEmptyStrings=false)]
- public string NomeFantasia { get; set; }
- [Required(ErrorMessage = "Razão Social é obrigatório", AllowEmptyStrings = false)]
- public string RazaoSocial { get; set; }
- [Required(ErrorMessage = "Inscrição Estadual é obrigatório", AllowEmptyStrings = false)]
- public string IE { get; set; }
- [Required(ErrorMessage = "CNPJ é obrigatório", AllowEmptyStrings = false)]
- public string CNPJ { get; set; }
- public Nullable<bool> Ativo { get; set; }
- public virtual ICollection<Entrada> Entrada { get; set; }
- public virtual ICollection<Produto> Produto { get; set; }
- public virtual ICollection<Fornecedor> CollectionFornecedores { get; set; }
- }
- public class SistemaContext : DbContext
- {
- public DbSet<Cliente> Clientes { get; set; }
- public DbSet<Fornecedor> Fornecedores { get; set; }
- }
- public ActionResult Index()
- {
- return View(db.Fornecedores.Where(s => s.Ativo == true).ToList());
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement