Skip to main content
adicionou 56 caracteres ao conteúdo
Fonte Link
user6026
user6026

CREATE TABLE [dbo].[uf]( [iduf] [int] NOT NULL, [sigla] varchar NOT NULL, [nome_uf] varchar NOT NULL, CONSTRAINT [PK_uf] PRIMARY KEY CLUSTERED ( [iduf] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 100) ON [PRIMARY] ) ON [PRIMARY]

GO

SET ANSI_PADDING OFF GO

CREATE TABLE [dbo].[uf](
    [iduf] [int] NOT NULL,
    [sigla] [varchar](2) NOT NULL,
    [nome_uf] [varchar](20) NOT NULL,
 CONSTRAINT [PK_uf] PRIMARY KEY CLUSTERED 
(
    [iduf] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 100) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

CREATE TABLE [dbo].[uf]( [iduf] [int] NOT NULL, [sigla] varchar NOT NULL, [nome_uf] varchar NOT NULL, CONSTRAINT [PK_uf] PRIMARY KEY CLUSTERED ( [iduf] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 100) ON [PRIMARY] ) ON [PRIMARY]

GO

SET ANSI_PADDING OFF GO

CREATE TABLE [dbo].[uf](
    [iduf] [int] NOT NULL,
    [sigla] [varchar](2) NOT NULL,
    [nome_uf] [varchar](20) NOT NULL,
 CONSTRAINT [PK_uf] PRIMARY KEY CLUSTERED 
(
    [iduf] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, FILLFACTOR = 100) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO
adicionou 406 caracteres ao conteúdo
Fonte Link

Tabela no Banco

CREATE TABLE [dbo].[uf]( [iduf] [int] NOT NULL, [sigla] varchar NOT NULL, [nome_uf] varchar NOT NULL, CONSTRAINT [PK_uf] PRIMARY KEY CLUSTERED ( [iduf] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 100) ON [PRIMARY] ) ON [PRIMARY]

GO

SET ANSI_PADDING OFF GO

Como retorno, tenho o seguinte:

Como retorno, tenho o seguinte:

Tabela no Banco

CREATE TABLE [dbo].[uf]( [iduf] [int] NOT NULL, [sigla] varchar NOT NULL, [nome_uf] varchar NOT NULL, CONSTRAINT [PK_uf] PRIMARY KEY CLUSTERED ( [iduf] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 100) ON [PRIMARY] ) ON [PRIMARY]

GO

SET ANSI_PADDING OFF GO

Como retorno, tenho o seguinte:

adicionou 232 caracteres ao conteúdo
Fonte Link
user6026
user6026

namespace Dominio { using System; using System.Collections.Generic; using System.Linq; using System.Text;

namespace Dominio
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    public class UF
    {
        private int iduf;
        private string nome;
        private string sigla;
    
        public  int IdUf
        {
            get { return this.iduf; }
            set { this.iduf = value; }
        }

        public  string Nome
        {
            get { return this.nome; }
            set { this.nome = value; }
        }

        public  string Sigla
        {
            get { return this.sigla; }
            set { this.sigla = value; }
        }

    }

}

namespace DAO { class UFConfig:EntityTypeConfiguration { public UFConfig() {

}



namespace DAO
{
    class UFConfig:EntityTypeConfiguration<UF>
    {
        public UFConfig()
        {


            this.HasKey(u => u.IdUf);
            this.Property(u =>u.IdUf).HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
            this.Property(u => u.Sigla);
            this.Property(u => u.Nome);

            this.ToTable("uf");
            this.Property(u => u.IdUf).HasColumnName("IDUF") ;
            this.Property(u => u.Sigla).HasColumnName("SIGLA");
            this.Property(u => u.Nome).HasColumnName("nome_UF");
            
            
        }
    }
}

}

namespace Dominio { using System; using System.Collections.Generic; using System.Linq; using System.Text;

public class UF
{
    private int iduf;
    private string nome;
    private string sigla;

    public  int IdUf
    {
        get { return this.iduf; }
        set { this.iduf = value; }
    }

    public  string Nome
    {
        get { return this.nome; }
        set { this.nome = value; }
    }

    public  string Sigla
    {
        get { return this.sigla; }
        set { this.sigla = value; }
    }

}

}

namespace DAO { class UFConfig:EntityTypeConfiguration { public UFConfig() {

        this.HasKey(u => u.IdUf);
        this.Property(u =>u.IdUf).HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
        this.Property(u => u.Sigla);
        this.Property(u => u.Nome);

        this.ToTable("uf");
        this.Property(u => u.IdUf).HasColumnName("IDUF") ;
        this.Property(u => u.Sigla).HasColumnName("SIGLA");
        this.Property(u => u.Nome).HasColumnName("nome_UF");
        
        
    }
}

}

namespace Dominio
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    public class UF
    {
        private int iduf;
        private string nome;
        private string sigla;
    
        public  int IdUf
        {
            get { return this.iduf; }
            set { this.iduf = value; }
        }

        public  string Nome
        {
            get { return this.nome; }
            set { this.nome = value; }
        }

        public  string Sigla
        {
            get { return this.sigla; }
            set { this.sigla = value; }
        }

    }
}



namespace DAO
{
    class UFConfig:EntityTypeConfiguration<UF>
    {
        public UFConfig()
        {


            this.HasKey(u => u.IdUf);
            this.Property(u =>u.IdUf).HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
            this.Property(u => u.Sigla);
            this.Property(u => u.Nome);

            this.ToTable("uf");
            this.Property(u => u.IdUf).HasColumnName("IDUF") ;
            this.Property(u => u.Sigla).HasColumnName("SIGLA");
            this.Property(u => u.Nome).HasColumnName("nome_UF");
            
            
        }
    }
}
adicionou 844 caracteres ao conteúdo
Fonte Link
Carregando
Corrigi alguns errinhos de português e deixei o conteúdo mais claro e sem redundancias.
Fonte Link
Carregando
Fonte Link
Carregando