I am new to EF code first approach, what I am trying to do is just inserting a record but somehow the database fails to generate in my SQL Server when my SubmitResult method is executed. I placed a breakpoint at unitOfWork.Save();
and it went through without catching any errors, I assume that if my connection string is invalid it would have thrown an exception. What could possibly be causing this?
Thanks.
[HttpPost]
public JsonResult SubmitResult(String signedRequest, String facebookName, String email, int score, String title)
{
DateTime now = ConstantHelper.GetCurrentTime();
try
{
FacebookSignedRequestUtility fbSignedRequestUtility = new FacebookSignedRequestUtility();
fbData = fbSignedRequestUtility.Parse(FacebookUtility.AppSecret, signedRequest);
Entry entry = new Entry();
entry.Fbuid = fbData.FBUID;
entry.FacebookName = facebookName;
entry.Email = email;
entry.Score = score;
entry.Title = title;
entry.CreatedDateTime = now;
entry.ModifiedDateTime = now;
unitOfWork.EntryRepository.Insert(entry);
unitOfWork.Save();
}
catch (Exception ex)
{
return Json(new { status = "false" });
}
return Json(new { status = "true" });
}