public IHttpActionResult PostProfile(string name, string path)
 {
     ProfileDal.Profiles.Add(new Profile()
     {
         name = name, path = path
     });
     ProfileDal.Save();
     return(Ok());
 }
Example #2
0
        /// <summary>
        /// 获取一条数据
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public ReturnResult <Profile> GetOne(Profile model)
        {
            var rst = new ReturnResult <Profile>();

            using (var dal = new ProfileDal())
            {
                rst = dal.GetOne(model);
            }

            return(rst);
        }
Example #3
0
        /// <summary>
        /// 删除一条数据
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public ReturnResult <bool> Delete(Profile model)
        {
            var rst = new ReturnResult <bool>();

            using (var dal = new ProfileDal())
            {
                rst = dal.Delete(model);
            }

            return(rst);
        }
Example #4
0
        /// <summary>
        /// 新增多条数据
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public ReturnResult <bool> AddList(List <Profile> list)
        {
            var rst = new ReturnResult <bool>();

            using (var dal = new ProfileDal())
            {
                rst = dal.AddList(list);
            }

            return(rst);
        }