Ejemplo n.º 1
0
        public override async Task <Camp> UpdateAsync(Camp t)
        {
            if (t == null)
            {
                return(null);
            }
            var entity = _context.Camps.Find(t.CampId);

            if (entity == null)
            {
                return(null);
            }

            try
            {
                UpdateModifiedDate(t);
                _context.Entry(entity).CurrentValues.SetValues(t);

                await _context.SaveChangesAsync();

                return(entity);
            }
            catch (Exception e)
            {
                Log.Instance.Error(e);
                throw;
            }
        }
        protected override async Task <CampRoomOption> Add(CampRoomOption t)
        {
            try
            {
                _context.CampRoomOptions.Add(t);
                await _context.SaveChangesAsync();
            }
            catch (Exception e)
            {
                Log.Instance.Error(e);
            }

            return(t);
        }
Ejemplo n.º 3
0
        protected override async Task <User> Add(User user)
        {
            try
            {
                _context.ApplicationUsers.Add(user);
                await _context.SaveChangesAsync();
            }
            catch (Exception e)
            {
                Log.Instance.Error(e);
            }

            return(user);
        }