ClassMember
namespaceGerenciaIgreja.Models{publicclassMembro{publicMembro(){DataCadastro=DateTime.Now;}publicintId{get;set;}publicDateTimeDataCadastro{get;set;}publicstringNome{get;set;}[Required][DisplayFormat(DataFormatString="{0:dd/MM/yyyy}")]
[Display(Name = "Data de Nascimento")]
public DateTime DataNascimento { get; set; }
[Required]
public string Cpf { get; set; }
[Required]
public string Rg { get; set; }
public string Email { get; set; }
public string Telefone { get; set; }
public string Celular { get; set; }
public string Endereco { get; set; }
public bool Ativo { get; set; }
//[Required(ErrorMessage = "Função Ministerial é obrigatório")]
public FuncaoMinisterial FuncaoMinisterial { get; set; }
//public ICollection<Agenda1> Agenda1 { get; set; }
}
}
Class Ministries
public class FuncaoMinisterial { public FuncaoMinisterial() { dataCadastro = DateTime.Now; }
public DateTime dataCadastro { get; set; }
public int Id { get; set; }
[Required]
public string Nome { get; set; }
public virtual ICollection<Membro> Membros { get; set; }
public bool Ativo { get; set; }
}
I now need to perform an insert on the bank in the members table. For this I need to pass the normal attributes of the member class plus the ministrial function object that is behaving like an attribute of the member class. For this I get an id (value) along with my controller address (url) and I pass in a method .post
of jQuery , to get the object functionMinisterial , the problem is there ... Take that blessed object.