Пример #1
0
        private static AccountDTO update(Account entity, AccountDTO account, OpenNosContext context)
        {
            if (entity != null)
            {
                Mapper.Mappers.AccountMapper.ToAccount(account, entity);
                context.Entry(entity).State = EntityState.Modified;
                context.SaveChanges();
            }
            if (Mapper.Mappers.AccountMapper.ToAccountDTO(entity, account))
            {
                return account;
            }

            return null;
        }
Пример #2
0
        private static MapMonsterDTO update(MapMonster entity, MapMonsterDTO mapMonster, OpenNosContext context)
        {
            if (entity != null)
            {
                Mapper.Mappers.MapMonsterMapper.ToMapMonster(mapMonster, entity);
                context.Entry(entity).State = EntityState.Modified;
                context.SaveChanges();
            }
            if (Mapper.Mappers.MapMonsterMapper.ToMapMonsterDTO(entity, mapMonster))
            {
                return(mapMonster);
            }

            return(null);
        }
Пример #3
0
        private static MinigameLogDTO update(MinigameLog entity, MinigameLogDTO account, OpenNosContext context)
        {
            if (entity != null)
            {
                Mapper.Mappers.MinigameLogMapper.ToMinigameLog(account, entity);
                context.Entry(entity).State = EntityState.Modified;
                context.SaveChanges();
            }
            if (Mapper.Mappers.MinigameLogMapper.ToMinigameLogDTO(entity, account))
            {
                return(account);
            }

            return(null);
        }
Пример #4
0
        private static GeneralLogDTO update(GeneralLog entity, GeneralLogDTO GeneralLog, OpenNosContext context)
        {
            if (entity != null)
            {
                Mapper.Mappers.GeneralLogMapper.ToGeneralLog(GeneralLog, entity);
                context.Entry(entity).State = EntityState.Modified;
                context.SaveChanges();
            }
            if (Mapper.Mappers.GeneralLogMapper.ToGeneralLogDTO(entity, GeneralLog))
            {
                return(GeneralLog);
            }

            return(null);
        }
Пример #5
0
        private static ShopDTO update(Shop entity, ShopDTO shop, OpenNosContext context)
        {
            if (entity != null)
            {
                Mapper.Mappers.ShopMapper.ToShop(shop, entity);
                context.Entry(entity).State = EntityState.Modified;
                context.SaveChanges();
            }
            if (Mapper.Mappers.ShopMapper.ToShopDTO(entity, shop))
            {
                return(shop);
            }

            return(null);
        }
Пример #6
0
        public QuestLogDTO Update(QuestLog old, QuestLogDTO replace, OpenNosContext context)
        {
            if (old != null)
            {
                Mapper.Mappers.QuestLogMapper.ToQuestLog(replace, old);
                context.Entry(old).State = EntityState.Modified;
                context.SaveChanges();
            }
            if (Mapper.Mappers.QuestLogMapper.ToQuestLogDTO(old, replace))
            {
                return(replace);
            }

            return(null);
        }