Пример #1
0
        public bool Insert <T>(string userId, T model) where T : class
        {
            Logger.DebugFormat("Insert({0}):{1}", userId, model.GetType());
            bool insertStatus = false;

            try
            {
                using (var db = new CloudCompareContext())
                {
                    db.Entry(model).State = EntityState.Added;
                    db.SaveChanges();
                    insertStatus = true;
                }
            }
            catch (Exception ex)
            {
                Logger.Error(ex.Message, ex);
            }
            return(insertStatus);
        }