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; }
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); }
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); }
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); }
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); }
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); }