Example #1
0
        public async Task <int> Delete(int id)
        {
            var deleteCollection = new PreSalescollection {
                Id = id
            };

            _context.PreSalescollection.Attach(deleteCollection);
            _context.PreSalescollection.Remove(deleteCollection);
            _context.SaveChanges();
            return(id);
        }
Example #2
0
        public async Task <int> AddNewCollection(CollectionModel model)
        {
            var newCollection = new PreSalescollection()
            {
                Description = model.Description,
                value       = model.value,
                ProjecstID  = model.ProjectsID,
            };

            await _context.PreSalescollection.AddAsync(newCollection);

            await _context.SaveChangesAsync();

            return(newCollection.Id);
        }