Example #1
0
        public JsonResult <object> MailVarify([FromBody] JObject json)
        {
            StudentVM re  = JsonConvert.DeserializeObject <StudentVM>(json.ToString());
            var       obj = new object();
            Dictionary <string, object> dic = new Dictionary <string, object>();

            try
            {
                if (!string.IsNullOrWhiteSpace(re.EmailId))
                {
                    using (StudentsEntities context = new StudentsEntities())
                    {
                        var result = context.MailVarify(re.EmailId).ToList();
                        if (result.Count <= 0)
                        {
                            dic.Add("Status", "1");
                            dic.Add("Message", "Varifyed");
                        }
                        else
                        {
                            dic.Add("Status", "2");
                            dic.Add("Message", "Already Registered!");
                        }
                    }
                }
            }
            catch (Exception E)
            {
                dic.Add("Message", E.Message);
                dic.Add("Status", "0");
            }
            obj = dic;
            return(Json(obj));
        }