public override void Update(UserProfileModel entity) { try { if (string.IsNullOrEmpty(entity.Photo)) { var targerEntity = GetById(entity.Id); targerEntity.Name = entity.Name; GetRepository.Update(targerEntity); WorkWithMssql.Commit(); } else { base.Update(entity); } } catch (Exception e) { Logger.Error(e.Message); } }
public override void Update(UserModel user) { try { var targerUser = GetById(user.Id); if (user.Password != null && user.Password != targerUser.Password) { targerUser.Password = user.Password; } targerUser.Profile.Name = user.Profile.Name; ComparisonPropertyValues(user, targerUser); GetRepository.Update(targerUser); WorkWithMssql.Commit(); } catch (Exception e) { Logger.Error(e.Message); } }