how to get the last insert mail in asp.net mvc?

By Sukhankshama Nayak

i got the error in db (object reference is required to access non-static member in db)

public static object GetOrderEmail(List lunch1)
{

        StringBuilder email = new StringBuilder();
        string textt = "";
        foreach (var lunch in lunch1)
        {
         Lunch lun = db.Lunch.OrderByDescending(p => p.Email).FirstOrDefault().Email;
            email.AppendFormat(lunch.Email);
            textt =lunch.Email;
}
        return textt;
    }

Source: Stack Overflow

    

Share it with your friends!

    Fatal error: Uncaught Exception: 12: REST API is deprecated for versions v2.1 and higher (12) thrown in /home/content/19/9652219/html/wp-content/plugins/seo-facebook-comments/facebook/base_facebook.php on line 1273