public IHttpActionResult PostProfile(string name, string path) { ProfileDal.Profiles.Add(new Profile() { name = name, path = path }); ProfileDal.Save(); return(Ok()); }
/// <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); }
/// <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); }
/// <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); }