예제 #1
0
            public async Task <List> insert(ListInsert List)
            {
                List newList = new List()
                {
                    nameList     = List.nameList,
                    colorHexList = string.IsNullOrEmpty(List.colorHexList) ? "#ffffff" : List.colorHexList,
                    statusList   = statusList.Active,

                    created = DateTime.Now,
                    updated = DateTime.Now
                };

                await _db.AddAsync(newList);

                await _db.SaveChangesAsync();

                return(newList);
            }
예제 #2
0
            public async Task <ListItem> insert(ListItemInsert ListItem)
            {
                ListItem newListItem = new ListItem()
                {
                    nameListItem   = ListItem.nameListItem,
                    descListItem   = ListItem.descListItem,
                    isDoneListItem = isDoneListItem.Undone,
                    idList         = ListItem.idList,

                    created = DateTime.Now,
                    updated = DateTime.Now
                };

                await _db.AddAsync(newListItem);

                await _db.SaveChangesAsync();

                return(newListItem);
            }