// GET api/<controller> public IEnumerable<Sys_BookmarkModel> Get() { string status = string.Empty; var service = new Sys_BookmarkServices(); var list = service.GetAllUseEntity<Sys_BookmarkEntity>(ref status); return list.Select(item => new Sys_BookmarkModel { ID = item.ID, Link = item.Link, Name = item.Name }); }
// GET api/<controller> public IEnumerable <Sys_BookmarkModel> Get() { string status = string.Empty; var service = new Sys_BookmarkServices(); var list = service.GetAllUseEntity <Sys_BookmarkEntity>(ref status); return(list.Select(item => new Sys_BookmarkModel { ID = item.ID, Link = item.Link, Name = item.Name })); }
public Sys_BookmarkModel Post([FromBody]Sys_BookmarkModel bookmark) { Guid userId = bookmark.UserID; var model = new Sys_BookmarkEntity { ID = bookmark.ID, Link = bookmark.Link, Name = bookmark.Name, UserID = userId, UserCreate = bookmark.UserCreate }; var service = new Sys_BookmarkServices(); service.Add<Sys_BookmarkEntity>(model); return bookmark; }
public Sys_BookmarkModel Post([FromBody] Sys_BookmarkModel bookmark) { Guid userId = bookmark.UserID; var model = new Sys_BookmarkEntity { ID = bookmark.ID, Link = bookmark.Link, Name = bookmark.Name, UserID = userId, UserCreate = bookmark.UserCreate }; var service = new Sys_BookmarkServices(); service.Add <Sys_BookmarkEntity>(model); return(bookmark); }