I've seen that an ASP.NET MVC project with C # has 2 magic tools that are EntityFramework and Scaffolding. With them it is possible in a few minutes to have all the registration features with in the database. Just bring the models with Entity and then create a controller with the scaffolding. Right? Well this is great for direct and simple entries. But what if I want to insert into two or more related tables simultaneously in my bank? Example: Is it possible, with the same ease I create the INSERT / UPDATE, etc for these 3 tables in a single form? A single page where I fill all the fields click on 1 button and tharam! I insert it into the 3 tables. Something similar to:
SELECT dbo.Tab_Aluno.*, dbo.Tab_Pessoa_Fisica.*, dbo.Tab_Contato.*
FROM dbo.Tab_Pessoa_Fisica
INNER JOIN dbo.Tab_Contato ON dbo.Tab_Pessoa_Fisica.Id_Contato = dbo.Tab_Contato.Id
INNER JOIN dbo.Tab_Aluno ON dbo.Tab_Pessoa_Fisica.Id = dbo.Tab_Aluno.Id_Pessoa_Fisica
The template would be:
public class CadastroAluno
{
public int CPF { get; set; }
public string Nome { get; set; }
public string Sexo { get; set; }
public DateTime DataDeNascimento { get; set; }
public string ContatoPrincipal { get; set; }
public string TelefonePrincipal { get; set; }
public string TelefoneSecundario { get; set; }
public string Email { get; set; }
public int Matricula { get; set; }
public byte Foto { get; set; }
public DateTime DataMatricula { get; set; }
public string Status { get; set; }
}