0
Class Member
namespace GerenciaIgreja.Models { public class Membro { public Membro() {
DataCadastro = DateTime.Now; }
public int Id { get; set; }
public DateTime DataCadastro { get; set; }
public string Nome { 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 Ministerial office
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; }
}
Now I need to perform a Insert in the database, in the member table. For this I need to pass the normal attributes of the classes member plus the object ministerial function that is behaving as a class attribute member. For this I take an id(value) along with my controller(url) address and pass a method .post
of jQuery, to pick up the object official, the problem is there... to catch that blessed object.
The
return response;
ofrecupera_funcao_ministerial
does not make sense, but it is better to put the place where this function is being used to be easy to propose an alternative solution.– Isac
The error occurs in the penultimate line pasted here, in the
return
of functionrecupera_funcao_ministerial
.– Jefferson Quesado
@Jeffersonquesado is "kind of hard" (impossible) o
return
working with asynchronous things :)– Guilherme Nascimento
Thanks @Jeffersonquesado , vlw for the tip.
– Neto Santos