Example #1
0
        /// create user
        public async Task <User> CreateUser(User inboundData)
        {
            User user = new User()
            {
                Id   = inboundData.Id,
                Name = inboundData.Name
            };

            _context.Entry(user).State = EntityState.Added;
            await _context.SaveChangesAsync();

            return(user);
        }
Example #2
0
        public async Task <Design> CreateDesign(DesignDto incomingData)
        {
            Design design = new Design
            {
                Id           = incomingData.Id,
                Title        = incomingData.Title,
                DesignCoords = incomingData.DesignCoords,
                TimeStamp    = DateTime.Now
            };

            _context.Entry(design).State = Microsoft.EntityFrameworkCore.EntityState.Added;
            await _context.SaveChangesAsync();

            return(design);
        }
Example #3
0
 // Check to make sure we don't need to pass in id
 public async Task AttachActivityLogToUser(int id, int userId)
 {
     _context.Entry(userId).State = Microsoft.EntityFrameworkCore.EntityState.Modified;
     await _context.SaveChangesAsync();
 }