public bool Update(UpdateConfigurationDTO dto) { var validationResult = new UpdateConfigurationValidator().Validate(dto); if (validationResult.IsValid) { return(_storageProvider.Update(dto)); } return(false); }
public bool Update(UpdateConfigurationDTO dto) { var filter = Builders <MongoDbConfigurationEntity> .Filter.AnyEq("_id", new ObjectId(dto.Id)); var update = Builders <MongoDbConfigurationEntity> .Update.Set("Value", dto.Value).Set("IsActive", dto.IsActive) .Set("Type", dto.Type).CurrentDate("LastModifyDate"); var result = Collection.UpdateOne(filter, update); return(result.IsAcknowledged ? result.ModifiedCount > 0 : result.IsAcknowledged); }
public bool Update(UpdateConfigurationDTO dto) { using (var context = new ConfigurationContext(GetConfigurationContextOptions())) { var entity = context.Configurations.AsQueryable().FirstOrDefault(a => a.Id == int.Parse(dto.Id)); if (entity != null) { entity.LastModifyDate = DateTime.Now; entity.Value = dto.Value; entity.Type = dto.Type; entity.IsActive = dto.IsActive; context.SaveChanges(); return(true); } return(false); } }
public bool Update(UpdateConfigurationDTO dto) { using (var dbConnection = Connection) { var query = "UPDATE \"Configuration\" SET \"Value\" = @Value," + " \"Type\" = @Type, \"IsActive\"= @IsActive, \"LastModifyDate\"= @LastModifyDate " + " WHERE \"Id\" = @Id"; dbConnection.Open(); dbConnection.Execute(query, new { Id = int.Parse(dto.Id), Value = dto.Value, IsActive = dto.IsActive, Type = dto.Type, LastModifyDate = DateTime.Now }); } return(true); }
public bool Update(UpdateConfigurationDTO dto) { throw new NotImplementedException(); }
public bool Update(UpdateConfigurationDTO dto) { var validationResult = new UpdateConfigurationValidator().Validate(dto); return(validationResult.IsValid && _storageProvider.Update(dto)); }
public ActionResult <bool> Update([FromBody] UpdateConfigurationDTO dto) { return(_configurationEngine.Update(dto)); }