Esempio n. 1
0
        public string PostPeople(StockUser v)
        {
            try
            {

                db.StockUsers.Add(v);
                db.SaveChanges();

            }
             catch (Exception ex)
            {
                var x = new AppLog() { LogDate = DateTime.Now, msg = "inside save" + ex.Message + ex.InnerException.Message };
                db.AppLog.Add(x);
                db.SaveChanges();
                throw;
            }
            return "{'Id':1,'UserName':'******'}";
        }
Esempio n. 2
0
 public String PostPeople(StockUser u)
 {
     return JsonConvert.SerializeObject(new StockUser() { Id = 1, UserName = "******" });
 }