Esempio n. 1
0
 // 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
     });
 }
Esempio n. 2
0
        // 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
            }));
        }
Esempio n. 3
0
        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;
        }
Esempio n. 4
0
        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);
        }