コード例 #1
0
ファイル: NewsKindDAL.cs プロジェクト: eggeggss/OfficialCore
        public bool Update(NewsKindNew prokind)
        {
            {
                Func <bool> func = new Func <bool>(() =>
                {
                    _entity.Entry(prokind).State = EntityState.Modified;
                    _entity.SaveChanges();

                    return(true);
                });

                return(_adapter.Catch <bool>(func));
            }
        }
コード例 #2
0
ファイル: NewsKindDAL.cs プロジェクト: eggeggss/OfficialCore
        public bool Insert(NewsKindNew pro_kind)
        {
            {
                Func <bool> func = new Func <bool>(() =>
                {
                    _entity.NewsKindNew.Add(pro_kind);
                    try
                    {
                        _entity.SaveChanges();
                    }
                    catch (Exception ex)
                    {
                        throw new Exception(ex.Message);
                    }
                    return(true);
                });

                return(_adapter.Catch <bool>(func));
            }
        }